Java Web project maintenance

Source: Internet
Author: User

Let's talk about Java again. JDK should be installed every time, environment variables should be set, and a helloworld should be compiled to run it. Record it again below:

1. Set java_home as the JDK root directory

2. Add % java_home % bin to path

3. Set classpath to ".; % java_home %/lib/dt. jar; % java_home %/lib/tools. Jar"

At this point, helloworld compilation should not be a problem.

 

This is a project about Web [struts2 + hibernate + Spring ].

First, I read corejsp. The simplest JSPProgram:

The time on the server is

Later, the book used a lot of space to explain the tag usage of JSP and some concepts related to serverlet. As standard, a WEB-INF folder under the root directory of the Java Web program, the WEB-INF directory contains the web. XML file as well as two different directories: classes and Lib. classes contains Servlet and Utility Classes needed by the application. LIB contains jar files that might contain Servlets, JavaBeans, and utility classes that might be useful to the application. the web. XML file, commonly known as the deployment descriptor, contains configuration and deployment information about the web application. it can contain information about the application in general, such as MIME type mappings, error pages, session configuration, and security. it can contain information about definitions and mappings to both JSP pages and servlets. another type of information that can be contained within the deployment descriptor is servlet context initialization parameters.

 

Next, let's take a look at struts2.

Your browser sends to the Web server a request for the URL http: // localhost: 8080/tutorial/helloworld. Action.

  1. The container has es from the Web server a request for the resourceHelloworld. Action. According to the settings loaded from the Web. XML, the container finds that all requests are being routedOrg. Apache. struts2.dispatcher. filterdispatcher, Including*. ActionRequests. The filterdispatcher is the entry point into the framework.
  2. The framework looks for an action mapping named "helloworld", and it finds that this mapping corresponds to the class "helloworld". The framework instantiates the action and callthe Action'sExecuteMethod.
  3. TheExecuteMethod sets the message and returnsSuccess. The framework checks the action mapping to see what page to load ifSuccessIs returned. The framework tells the container to render as the response to the request, the resourceHelloworld. jsp.
  4. As the pageHelloworld. jspIs being processed, Tag callthe GetterGetmessageOfHelloworldAction, and the tag merges into the response the value of the message.
  5. A pure hmtl response is sent back to the browser.

For detailed information on Struts 2 architecture see big picture.

Finally, I read about Hibernate and tutorial of spring, and I have some knowledge about these technologies.

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.