Use JSP with Eclipse in Ubuntu

Source: Internet
Author: User

(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 'cooldnot load the Tomcat server configuration at/usr/share/tomcat7/conf. the configuration may be updated upt 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 specified atfirst 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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.