程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> JSP編程 >> 關於JSP >> Use JSP with Eclipse in Ubuntu

Use JSP with Eclipse in Ubuntu

編輯:關於JSP

(1)Install Tomcat7 in Ubuntu:

It is very easy to install tomcat7 in ubuntu. Just refer to[1],

(1)type the command:

sudo apt-get install tomcat7,

(2) check the website http://localhost:8080/

In my version it is showed like this:

\


      (2) If you have already use the JavaEE eclipse, you can skip this step. Otherwise you need to install the JavaEE plugin[3] and JSTServer Adapters[4](if you ignore the JST Server Adapter you will not see the tomcat server).



        (3)Create tomcat7 server in eclipse, basically just “ click on Servers tab at bottom of eclipse. (If you don't see Servers tab,add the tab via Window, Show View, Servers.) R-click on Servers tab,New, Server, Apache, Tomcat v7.0 ”[2][6].

        In ubuntu the tomcat7's installation directory is usually“/usr/share/tomcat7”if you follow step1.

        If you run into some trouble like 'Couldnot load the Tomcat server configuration at /usr/share/tomcat7/conf.The configuration may be corrupt or incomplete/usr/share/tomcat7/conf/catalina.policy (No such file ordirectory)', follow the instruction[5].



          (4)Afterthat you can create a “dynamic web project” in the eclipse,create a .jsp file,

          writea hello world code lie:

          <%

          out.print("HelloJSP");

          %>


          run it, if you failed because of port is being used, stop the tomcatfirst with the command

          sudo/etc/init.d/tomcat7 stop

          or refer to[6]


          Reference:

          [1]:http://sukharevd.net/environment-for-j2ee-development-under-ubuntu.html#tomcat

          [2]:https://www.cise.ufl.edu/~bn0/jsp_eclipse_tutorial/

          [3]:http://coding-for-dummies.blogspot.com/2012/10/how-to-get-dynamic-web-project-option.html

          [4]:http://stackoverflow.com/questions/2000078/apache-tomcat-not-showing-in-eclipse-server-runtime-environments

          [5]:http://stackoverflow.com/questions/13423593/eclipse-4-2-juno-cannot-create-a-server-using-the-selected-type-in-tomcat-7

          [6]:http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html


  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved