How to assign a Web project to a configured server when debugging Web projects in eclipse

Source: Internet
Author: User

For example, I'm doing the example of spring and struts2 integration today.

New Project Blk

1, the configuration good web.xml,struts.xml,applicationcontext.xml, write good JSP page

2, the STRUTS2, spring integration needs of the jar package (struts core jar package, Spring core jar package and Struts-spring-plugin.jar, Commons-logging.jar) into your project's Web-inf/lib directory

3. Write the Java code and copy the Java code compiled class file to the Web-inf/classes directory.

4, create a new server, the name is BLK

5. Right click on the server and select "Add and Remove"

6. Select the item blk and click "Add", then confirm

View Servers/blk-config/server.xml in project explore in eclipse

You can see that eclipse automatically generates a context node for you

<context docbase= "Blk" path= "/blk" reloadable= "true" source= "Org.eclipse.jst.jee.server:blk"/>

7, open the browser: Enter localhost:8080/blk/login.jsp, done!

Note: Of course, you can also manually write Server.xml's context node, which is written but is in debug state, let Eclipse generation also convenient point. It's no harm if you're willing to write your handwriting.

Again , "The jar package you are using for your project is not to be put into Tomcat Lib!" Just put it in the web-inf/lib of your project! "

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.