Simple development process for SSM or SSH projects

Source: Internet
Author: User

Kit SSM or SSH2 jar package

New springmvc-servlet.xml--Configuration View resolver (prefix and suffix)

New applocationcontext.xml--configuration database connection, Sqlsessionfatory/sessionfactory Factory

<import resource= "" > Extract the External file, you can write the database connection to the Propeties file, and then import to the Applocationcontext.xml

Modify the web.xml--Add Listener (https://www.cnblogs.com/wuchaodzxx/p/6038895.html), Associating Master profile Springmvc-servlet.xml, associating other profile applocationcontext.xml, filter (Filter access address)

Adding entity classes

Configuring the *mapping.xml of an entity class

A factory association in Applocationcontext.xml that makes its other associated entity class mappings--*mapping.xml

Write the DAO layer, Service (SERVICE.IMPL) layer and the method that they need--service.impl to privatize the properties of a DAO object for invoking methods inside the DAO layer

Modify the mapping file of the entity class Mapping.xml file so that it corresponds to the method inside the DAO layer

In the form of an interface in the Applocationcontext.xml to inject a DAO layer of the object-here Hibernate and Struts2 interface implementation are given to SPRINGMVC management, in Springmvc do not know, Direct-pass scan of the resulting DAO object

or by scanning injection, or by annotating automatic assembly injection (note to go to Applocationcontext.xml to add package scan--<context:component-scan base-package= "package name, Package name ..." > </context:component-scan>

Modify the workspace in the *mapping.xml so that it corresponds to the interface class inside the DAO layer.

Write test class Test--Get ApplicationContext

How to write a controller

Writing annotations (@controller @RequestMapping ("Binding Interface")

Adding a controller's scan in Springmvc-servlet.xml

Pass value to page via JSONP--Guide Package (note package, core package, data binding package), add annotations (@RequestBody) on method, start annotations in Springmvc-servlet

Simple development process for SSM or SSH projects

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.