使用Eclipse开发Jsp

内容:

  开发环境

  建立工程

  参考资料

  关于作者



  Eclipse作为一个java应用的IDE,使用非常方便,但是对于Jsp的开发支持还显得不够,在这里向大家推荐一个eclipse的plugins来协助JSP开发。这个名称叫lomboz,不但支持JSP语法高亮显示,还有Code Assist功能,可以与Jbuilder媲美。下面简要介绍一下eclipse2.1结合Tomcat开发Jsp的过程。
开发环境

  1、软件

  名称         安装路径        下载网站

  j2sdk1.4.1_02   D:/j2sdk1.4.1_02   http://java.sun.com

  eclipse2.1     D:/eclipse2.1     http://www.eclipse.org/

  Tomcat 4.0     E:/Tomcat 4.0     http://java.apache.org/

  lomboz.21     D:/eclipse2.1/plugins http://www.objectlearn.com/

 注意:

  ·如果你使用eclipse2.0,那么请你下载2.1,在2.0下我尝试很多次都没有配置好lomboz.。

  ·以上是我电脑的安装路径,方便大家对照后面的配置进行修改

  2、配置软件

  下载好各软件,依次安装JDK,Tomcat, eclipse2.1后, 首先保证你的tomcat和eclipse2.1能够独立运行。

  把lomboz.21.zip解压缩后到把com.objectlearn.jdt.j2ee整个文件夹复制到eclipse2.1的plugins下。

配置eclipse2.1

  1.启动eclipse2.1,进入菜单【window】--->【Preference】--->【Java】--->【Classpath variables】选择【New】建立name为JDK_TOOLS Path为你JDK的Tools.jar的路径.[如:D:/j2sdk1.4.1_02/lib/tools.jar]

  同上,新建name为TOMCAT,path为Tomcat安装目录.[如:E:/Tomcat 4.0] 进入【window】--->【Customize Perspective】--->【Window>Show View】 选择Lomboz J2EE View 保存退出之后在你的eclipse2.1的工具栏中,如图位置,多一个按钮

160599.jpg

  2.进入【window】-【Preference】-【Java】-【new Project】,如图设置

160570.jpg

  配置lomboz.

  启动eclipse2.1,菜单【window】-【Preference】选择【Lomboz】如下图

160571.jpg

  在【LomBoz】的【JDK Tools.jar】设定你的JDK中的tools.jar的完全路径(包括文件)[如:D:/j2sdk1.4.1_02/lib/tools.jar],对照修改即可。

  选择【Server Definitions】如图

160610.jpg

  选择 【Server types】中选择 Apache Tomcat v4.0.1/4.0.2设定好你的Tomcat的目录,参照上图设定,如Application Server Directory 为E:/Tomcat 4.0,ClassPath Varible name 为上面设定的TOMCAT Classpath Varible 为E:/Tomcat 4.0 点【Apply】按钮,再查看【ClassPath】选项页,如果设置正确,那么应该是如下图所示,如果设置错误,Server Libraries会显示错误标记。

160573.jpg

  建立工程

  操作过程:

  菜单【new】-【Project】选择【Lomboz J2EE Wizards】-【Lomboz J2EE Project】,下一步输入你的工程名称,如图所示

160611.jpg

  下一步

  选择【Web Modules】添加Module 如图所示

160613.jpg

  输入 Module名称 [如:test]

  选择Targeted Servers ,选择配置好的【Apache Tomcat v 4.01/4.02】,添加后,完成,如图所示[界面可能跟个人的界面设置不同而有所不同]

160624.jpg

  点上面介绍的的那个hint为 Press to open a J2EE project Outliner的按钮,打开Lomboz J2EE View,如图所示,选择Run Server菜单,启动Tomcat,在你的浏览器输入 http://localhost:8080/test/index.jsp看看。显示的页面是index.jsp。

160577.jpg

160578.jpg

  就这么简单,其实Lomboz不仅仅支持Jsp,还支持EJB的开发,部署和测试等其他J2EE应用。可以参照LOMBOZ Tutorials使用。

eclipse开发jsp的配置问题

03-06

2006-3-6 13:30:10 org.apache.catalina.startup.Catalina loadrn信息: Initialization processed in 1469 msrn2006-3-6 13:30:11 org.apache.catalina.core.StandardService startrn信息: Starting service Catalinarn2006-3-6 13:30:11 org.apache.catalina.core.StandardEngine startrn信息: Starting Servlet Engine: Apache Tomcat/5.0.28rn2006-3-6 13:30:11 org.apache.catalina.core.StandardHost startrn信息: XML validation disabledrn2006-3-6 13:30:11 org.apache.catalina.core.StandardHost getDeployerrn信息: Create Host deployer for direct deployment ( non-jmx ) rn2006-3-6 13:30:11 org.apache.catalina.core.StandardHostDeployer installrn信息: Processing Context configuration file URL file:D:\Program Files\Apache Software Foundation\Tomcat 5.0\conf\Catalina\localhost\balancer.xmlrn2006-3-6 13:30:11 org.apache.commons.beanutils.MethodUtils getMatchingAccessibleMethodrn警告: Cannot use JVM pre-1.4 access bug workaround due to restrictive security manager.rn2006-3-6 13:30:12 org.apache.catalina.core.StandardHostDeployer installrn信息: Processing Context configuration file URL file:D:\Program Files\Apache Software Foundation\Tomcat 5.0\conf\Catalina\localhost\admin.xmlrn2006-3-6 13:30:12 org.apache.struts.util.PropertyMessageResources rn信息: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=truern2006-3-6 13:30:12 org.apache.struts.util.PropertyMessageResources rn信息: Initializing, config='org.apache.struts.action.ActionResources', returnNull=truern2006-3-6 13:30:13 org.apache.struts.util.PropertyMessageResources rn信息: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=truern2006-3-6 13:30:14 org.apache.catalina.core.StandardHostDeployer installrn信息: Processing Context configuration file URL file:D:\Program Files\Apache Software Foundation\Tomcat 5.0\conf\Catalina\localhost\manager.xmlrn2006-3-6 13:30:14 org.apache.catalina.core.StandardHostDeployer installrn信息: Installing web application at context path from URL file:D:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\ROOTrn2006-3-6 13:30:15 org.apache.catalina.core.StandardHostDeployer installrn信息: Installing web application at context path /jsp-examples from URL file:D:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\jsp-examplesrn2006-3-6 13:30:15 org.apache.catalina.core.StandardHostDeployer installrn信息: Installing web application at context path /servlets-examples from URL file:D:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\servlets-examplesrn2006-3-6 13:30:15 org.apache.catalina.core.StandardHostDeployer installrn信息: Installing web application at context path /webdav from URL file:D:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\webdavrn2006-3-6 13:30:15 org.apache.catalina.core.StandardHostDeployer installrn信息: Installing web application at context path /tomcat-docs from URL file:D:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\tomcat-docsrn2006-3-6 13:30:15 org.apache.coyote.http11.Http11Protocol startrn严重: Error starting endpointrnjava.net.BindException: Address already in use: JVM_Bind:8080rn at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:264)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.startEndpoint(PoolTcpEndpoint.java:281)rn at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:171)rn at org.apache.coyote.tomcat5.CoyoteConnector.start(CoyoteConnector.java:1527)rn at org.apache.catalina.core.StandardService.start(StandardService.java:489)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:556)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)rn2006-3-6 13:30:15 org.apache.catalina.startup.Catalina startrn严重: Catalina.start: rnLifecycleException: Protocol handler start failed: java.net.BindException: Address already in use: JVM_Bind:8080rn at org.apache.coyote.tomcat5.CoyoteConnector.start(CoyoteConnector.java:1529)rn at org.apache.catalina.core.StandardService.start(StandardService.java:489)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:556)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)rn2006-3-6 13:30:15 org.apache.catalina.startup.Catalina startrn信息: Server startup in 4828 msrnStandardServer.await: create[8005]: java.net.BindException: Address already in use: JVM_Bindrnjava.net.BindException: Address already in use: JVM_Bindrn at java.net.PlainSocketImpl.socketBind(Native Method)rn at java.net.PlainSocketImpl.bind(Unknown Source)rn at java.net.ServerSocket.bind(Unknown Source)rn at java.net.ServerSocket.(Unknown Source)rn at org.apache.catalina.core.StandardServer.await(StandardServer.java:496)rn at org.apache.catalina.startup.Catalina.await(Catalina.java:619)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:579)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)rn

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试