在eclipse如何运行jsp文件?

来源:互联网 发布:义乌悠悠淘宝摄影 编辑:程序博客网 时间:2024/06/11 15:20


1、安装JDK、配置JRE

    •Directory without blank inname

•JAVA_HOME
–Dir of JDK
•PATH
–%JAVA_HOME%\bin

2、安装tomcat


3、加压eclipse (KEPLER)

•Window-Preference-General-Workspace
•Set text file encoding to UTF-8
•Window-Show View-Servers-Create new Server
•Select your Tomcat pathand JDK
•Finish
•File – New – Dynamic web project
•Name
•Version2.5
•Default out folder =web/WEB-INF/classes
•Content directory = web
•Finish
Servers – Tomcat 6.0Server forlocalhost
•Modules – Add – Externalweb module
•Document base = yourproject’s web directory
•Path = /sp, Auto reloadingenabled = false
•OK
•File - Save
•Servers – Tomcat 6.0 for localhost
•Right click – debug
•See : Server start up inxxx ms

4、 右击 .jsp 文件 > Run As  > Run on server

在弹出的窗口中选择一个Tomcat

点击OK