Ssi framework quickly set up

    The framework of ssi is mainly composed of struts2, spring and ibaTIs. They are responsible for the interaction and collaboration between the layers, thus realizing the function realization and integration of the entire web. Struts is currently responsible for data transfer and control. Spring relies on its powerful dependency injection technology to implement functions like bean hosting and integration. Of course, this is just the tip of the iceberg in the spring function, and ibaTIs as a lightweight OR Mapping. The framework provides a semi-automated object-relational mapping implementation with a higher degree of freedom than hibernate.

    Framework:

    This is a structure diagram I found on the Internet about the ssi framework. I personally feel that the painting is quite good. For beginners, the level structure is very clear and practical (thanks to this big sharing):

    Ssi framework quickly set up

    Here you can clearly see the general structure of the ssi framework and the interaction between the layers. If the top-level presentation layer is Java, it is mainly the preparation of view layer technology such as jsp and html, which involves the familiar javascript. Jquery and extjs, etc. In the control layer, the strust2 tag function is used to implement the data interaction between the acTIon and the view layer. Of course, the same function can be implemented using the ajax technology, which is based on personal preference. At the business logic level. Mainly to use Spring's dependency injection to implement instance management of business logic classes and dao classes, of course, all kinds of instances can be managed in the spring for unified management and association, including transactions, data sources and so on. In the persistence layer, using the semi-automated object-relational mapping provided by ibaTIs, developers can write specific SQL statements as needed, and implement the operation of the database through the corresponding xml configuration.

    In short, the SSI framework can reduce the coupling of our code, enhance the robustness and reusability of the code, and speed up the development, but there are also some shortcomings, such as due to the more configuration files of the three frameworks, also bring us Some inconvenience, especially for smaller applications.

    SSI framework builds quickly

    1. Right click on New in the Package Explore and select the web project.

    Ssi framework quickly set up

    2. Enter the project name and click finish.

    Ssi framework quickly set up

    3, import struts2

    (1):

    Ssi framework quickly set up

    (2): Select Struts2.1 and select /*click next

    Ssi framework quickly set up

    (3): By default, click finish, import is complete

    Ssi framework quickly set up

    2, add Spring support

    (1) Right click project, select Add Spring Capabilities

    Ssi framework quickly set up

    (2), check the jar package, and select the second item in the JAR Library Installation, click next

    Ssi framework quickly set up

    (3), modify the Folder for WebRoot/WEB-INF click finish to complete the introduction of Spring

    Ssi framework quickly set up

    3, start to configure ibatis

    (1), add a configuration file in the applicationContext.xml file

    Ssi framework quickly set up

    (2), create a new path org.wwy.utils under src add sqlMapping.properties file

    Jdbc.url=jdbc\:mysql\://localhost\:3307/MyBatis

    Jdbc.username=root

    Jdbc.password=wwy520223

    (3), add sqlMapConfig.xml file under org.wwy.utils

    Ssi framework quickly set up

    (4), create a new entity package org.wwy.PO under src to write java entity class

    Package org.wwy.PO;

    Public class User {

    Private Long id;

    Private String name;

    Private String pwd;

    Private Long age;

    Private long sex;

    Public Long getId() {

    Return id;

    }

    Public void setId(Long id) {

    This.id = id;

    }

    Public String getName() {

    Return name;

    }

    Public void setName(String name) {

    This.name = name;

    }

    Public String getPwd() {

    Return pwd;

    }

    Public void setPwd(String pwd) {

    This.pwd = pwd;

    }

    Public Long getAge() {

    Return age;

    }

    Public void setAge(Long age) {

    This.age = age;

    }

    Public Long getSex() {

    Return sex;

    }

    Public void setSex(Long sex) {

    This.sex = sex;

    }

    }

    (5), add User.xml mapping file under org.wwy.PO

    Ssi framework quickly set up

    4, add spring listener in web.xml

    Ssi framework quickly set up

    Complete SSI framework construction

    5, start tomcat test SSI framework, error:

    Caused by: java.lang.ClassNotFoundException: com.ibatis.common.xml.NodeletException

    At org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1324)

    At org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1177)

    . .. 33 more

    6. Download the ibatis jar package and copy it to the WEB-INF/lib directory, then import it from the buildpath and retest it.

    CCTV Tester

    CCTV Tester,Cctv Camera Tester,Monitor Tester,IP Camera Test Monitor

    Chinasky Electronics Co., Ltd. , https://www.cctv-products.com

    Previous Post: 3D printing market situation analysis industry death notes are happening
    Next Post: Apple recently announced patent application for "autonomous navigation system"
    Home
    Recent Posts
    • "Settings" do not make desktop shortcu…
    • How does Smart Water reduce leakage in the pipe …
    • A New Type of Printable Chipless RFID Tag
    • Is it immersing you in the picture? No, it's…
    • Google, Baidu, Intel, AMD, Harvard University an…
    • About MOSFET driving circuit for switching power…
    • Neural Network Slimming: Innovations and Network…
    • The pickup distance and angle of the microphone …
    • Russian scientists find ways to improve magnetic…
    • Overview of 3D Printing Technology and Status an…
    • God painting F1 depth evaluation: the screen is …
    • Suppression of PCB Interference, How to Minimize…
    • How to use cloud storage
    • No. 18 Jining Road (No. 400 Tongtong North Road …
    • New energy vehicle charging market is new, when …
    • Suppose that a high-end refrigerator made of &qu…
    • How to select the correct type of embedded syste…
    • The charger will burn if it burns. _What is the …
    • Are you ready for the 2018 World Cup big screen?
    • How does a family's smart TV watch "pap…