Use JSP with Eclipse in Ubuntu

(1)Install Tomcat7 in Ubuntu:

  1. 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:



    1. (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).



    1. (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].



    1. (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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值