----Summary of "SSH online mall"

Source: Internet
Author: User


SSH is an integrated framework for struts+spring+hibernate, which is a popular open-source framework for Web applications. the system of the integrated SSH framework is divided into four layers: presentation layer, business logic layer, data persistence layer and Domain module layer to help developers build clear, reusable and easy-to-maintain web applications in a short period of time.

Spring is a lightweight control inversion (IoC) and facet-oriented (AOP) container framework. Light Weight --at the beginning of doing itoo, you often hear a word: "Spring is a lightweight framework!" "But where does its lightness manifest?" Spring is lightweight both in terms of size and overhead. The full spring framework can be published in a jar file with a size of more than 1MB. and the processing overhead required by spring is negligible. In addition, spring is non-intrusive: Typically, objects in a spring application do not depend on a particular class of spring (this sentence is not very thorough, it should be related to spring injection, the path injected in the configuration file does not change, but the contents of the referred class can vary).   Control reversal --spring facilitates loose coupling through a technique called inversion of Control (IoC). When an IOC is applied, other objects that an object relies on are passed in passively, rather than the object itself creating or locating dependent objects. (A simple example: used to write C # when you want to use this object is to first new, the equivalent of the active, but if the control inversion technique, in the configuration file to write the namespace of the class. Class name, and then, when using this class, simply pass in a string of that class name to apply the class! )
facet-oriented --spring provides rich support for aspect-oriented programming, allowing for the development of cohesive systems-level services and transactions by separating the application's business logic. The Application object only implements what they should do-complete the business logic-that's all.
The concrete embodiment of spring application in SSH is the application of Applicationcontext.xml! Used to embody spring's injection! For example, inject DAO into the service.


Hibernate is an open-source object-relational mapping framework that provides JDBC with a very lightweight object encapsulation that allows Java programmers to manipulate databases at will using object programming thinking. Hibernate can be applied to any JDBC application, both in Java client applications and in servlet/jsp Web applications, and most revolutionary of all, hibernate can replace CMP in the EE architecture of the EJB application. The task of achieving data persistence. (a bunch of official words, summed up just like the EF in C #, convenient database links and entity generation!) )Hibernate has a total of 5 core interfaces: Session, sessionfactory, Transaction, query, and configuration. The most common way to get a session in Java is sessionfactory. But SSH mall inherits the class of DAO layerHibernatedaosupport class, this hibernatedaosupport class already has the method of getting session getsession, very useful. and let the DAO class inheritAlthough the Hibernatedaosupport class is useful, we need to inject sessionfactory dynamically. such as:     The explanation of this special class in Baidu Encyclopedia is: A Connection object in JDBC uses a transaction, so a transaction in Hibernate is bound to associate a sessionfactory, but this sessionfactory is not reflected in the DAO. In fact, the main reason is that the Hibernatedaosupport class has silently done the work of encapsulation, it uses a Setsessionfactory method to inject sessionfactory, So DAO that inherits from the Hibernatedaosupport class will have sessionfactory properties, so you can create a session instance operation database through Sessionfactory.


struts is an MVC framework based on the Java EE platform. and online mall with the Struts2, the latter more than the former one interceptor function, can make programming more flexible. (Not many of their own research, first come here, and so on after the sharing!) )
Struts.xml is used for form submission, page jump, action definition path, and so on. It is important to note that:the configuration error in Struts.xml is the full path in class, but does not include the extension of the class. such as:

          the middle of the JSP page to go to the absolute path. Means


Web. XML is the most basic, and may contain database connections, filters, listeners and other information configuration. Is the configuration of Web. xml inside SSH:




Small total:
Small series in the initial from VS jump to myeclipse programming tools after a variety of not adapt Ah! In the VS in a lot of shortcut keys so handy, to MyEclipse can not use! It's really annoying! But I still through their own exploration summed up a bit of the use of shortcut keys, hope can help everyone! 1. Ctrl + Left: used to view the definitions of variables, methods, classes 2. Ctrl+o: View an outline of a class that lists its methods and member variables. Tip: If you press Ctrl+o again, you can list the methods and variables that the class inherits. 3. Ctrl+t : Look at the inheritance tree of a class, is top-down, and then press once more ctrl+t, will be replaced by a bottom-up display structure.  Tip: Select a method name and press Ctrl+t to see the parent, subclass, and interface of the method with the same name.   4.alt+ Direction key : We often encounter when looking at the code CTRL + left, layer tracking, and then lost in the code of the situation, then only need to press "ALT + LEFT ARROW key " Can be returned to the last reading position, similarly, press "ALT + RIGHT ARROW key" will advance to just return to the reading position, just like the browser forward and Back button.   5, Global: All save ctrl+shift+s; Global all close Ctrl+shift+f4 6.Java Editor format ctrl+shift+f Java Editor Uncomment ctrl+/Java Editor Comments ctrl+/, or Ctrl+shift+c  

----Summary of "SSH online mall"

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.