(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