SSH three-frame popular understanding

Source: Internet
Author: User



First, talk about your understanding of struts.

1. Struts is a web-layer framework designed by MVC pattern, which is actually a big servlet, this Ervlet

Actionservlet, or a subclass of Actionservlet. We can match a certain feature in the Web. xml file

All requests are given to this servlet for processing, and the servlet references a configuration file (typically

/web-inf/struts-config.xml) Each request is assigned to a different action to handle.

An extended knowledge point: Struts can have more than one configuration file, which can be configured by module to

Excessive expansion of the configuration file;

2. Actionservlet the request parameters into a Formbean object before handing the request to the action (that is,

A Java class, where each property in this class corresponds to a request parameter), what kind of Formbean object is encapsulated into?

Look at the configuration file.

3. To illustrate, Actionservlet may call the Formbean object before passing it to the action's Execute method.

Formbean the Validate method to verify that the Formbean object is passed to the action only after the checksum is passed.

The Execute method, otherwise, it returns an error page that is specified by the input property (see configuration file)

Why did the author name This here the input attribute, rather than the error attribute, the actual running effect behind us is divided

Analysis

4.action to return the displayed result view after execution, the result view is represented by a Actionforward object,

The Actionforward object is associated to a JSP page through the configuration in the Struts-config.xml configuration file, because the program

Uses the logical name set for the JSP page in the Struts-config.xml configuration file, which enables the action program code to be

Returns the decoupling of the name of the JSP page.

Your experience with struts may also have its own application, and that should be said as well.

Second, talk about your understanding of hibernate.

1. Object-oriented design of the internal operation of the software can be understood to be in the continuous creation of new objects, establish the relationship between objects, call the method of the object to change the state of each object and the process of object extinction, regardless of the process and operation of the program, essentially to get a result, program The difference in the running result of a moment and the next is a change in the state of the object in memory.

2. In order to maintain the running state of the program in the case of shutdown and insufficient memory space, it is necessary to save the state of the object in memory to the persistence device and restore the state of the object from the persistence device, usually saving the large amount of object information to the relational database. From the running function of Java program, the function of saving object state, compared with other functions of the system, should be a very humble subordinate function, Java uses JDBC to achieve this function, this humble function is to write a lot of code, and do is only to save objects and restore objects, And the large number of JDBC code does not have any technical content, basically is a set of routine standard code template to write, is a kind of hard work and repetitive work.

3. Save the object and restore object from the Java program runtime through the database, actually realize the mapping relation between Java object and relational database record, called ORM (that is, Object Relation Mapping), people can realize this function by encapsulating the JDBC code. The encapsulated product is called an ORM framework, and Hibernate is one of the popular ORM frameworks. Using the Hibernate framework, instead of writing the JDBC code, simply invoking a save method, you can save the object to a relational database, and simply call a GET method to load an object from the database.

4. The basic process for using Hibernate is to configure a configuration object, generate Sessionfactory, create a Session object, start a transaction, complete a crud operation, commit a transaction, and close the session.

5. When using hibernate, configure the Hibernate.cfg.xml. config file, which configures the database connection information and dialect, and also configures the appropriate Hbm.xml file for each entity, hibernate.cfg.xml files need to register each hbm.xml File.

6. When applying hibernate, focus on understanding the session's caching principles, cascading, lazy loading, and hql queries.

Third, your understanding of spring.

1.Spring implements factory-mode factory classes (where it is necessary to explain what a Factory mode is), this class is named

Beanfactory (actually an interface), which is usually beanfactory subclass ApplicationContext in a program. Spring

Equivalent to a large factory class that configures the class name and instance used to create the instance object in its configuration file through the <bean> element

The properties of the object.

2. Spring provides good support for IOC, the IOC is a programming idea and an architectural art that can be used to

The decoupling between modules is well implemented. IOC is also called DI (depency injection), what is dependency injection?

For example, Class Programmer

{

Computer computer = NULL;

public void Code ()

{

Computer computer = new Ibmcomputer ();

Computer computer = Beanfacotry.getcomputer ();

Computer.write ();

}

public void Setcomputer (computer computer)

{

This.computer = computer;

}

}

the other two ways are dependent , the first one is directly dependent on the target class , The second one shifts the dependency to the factory. , a third thorough

decoupled from the target and factory. Configure the snippet in the spring configuration file as follows :

<bean id= " Computer " class= " Cn.itcast.interview.Computer " >

</bean>

    <bean id= Span style= "Color:black" > " programmer " class = " cn.itcast.in Terview. Programmer "

<property name= " Computer " ref= " Computer " ></property>

</bean>

3. Spring AOP good encapsulation of the technology

<bean id= " proxy " type= " org.spring.framework.aop.proxybeanfactory " >

<property name= " Target " ref= "" ></property>

<property name= " Advisor " ref= "" ></property>

</bean>

SSH three-frame popular understanding

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.