Summary of Java Framework issues (i)

Source: Internet
Author: User

One, JSP and servlet are the same and different?

1.servlet is a Java program running on the server, dynamically generating Web content, and JSP can understand that, you can add Java code in HTML, so page rendering results can be directly changed using the editor such as Dreamweaver, easier and faster Without maintaining the code in the Java class. Implement understanding coupling.

The essence of 2.jsp is the servlet, which is simply a servlet that uses a different set of rules, and it runs on the need to compile the Java code and then output it, which is done by the JSP container.

3.jsp is better at displaying pages, and Servlets are better at logic control . The biggest difference is that the development interface is that the JSP can be written directly, and the servlet needs to be implemented using the OUT.PRINTLN () statement.

4.JSP is compiled into a servlet when it is first run and resides in memory for invocation.

Ii. What is Hibernate's implementation process?

1, the application calls the configuration class first, which reads the hibernate configuration file and the information in the mapping file;

2, using this information to generate a Sessionfactory object;

3, then generate a Session object from the Sessionfactory object;

4, using the Session object to generate transaction objects;

5. Persistent operation of data;

6, closed session;

7, close the sessionfactory.

Iii. What is the implementation process of STRUTS2?

1, the client sends a request;

2, request through a series of filter filters, including struts2 core filter filterdispacher;

3, Filterdispacher will ask Actionmapper if you need to invoke an action;

4, if the decision to invoke an action, the core controller will give the processing rights to a actionproxy to handle;

5. The action agent accesses the Struts2 configuration file, finds the action that needs to be invoked, and creates an actioninvocation instance;

6. The invocation instance invokes a series of struts2 filters, including user-defined filters;

7. The invocation instance is responsible for finding the corresponding return results according to the Struts2.xml configuration file, and returning to the foreground display.

Summary of Java Framework issues (i)

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.