Build an SSH project framework

Source: Internet
Author: User

Build an SSH project framework

1. Import jar packages (38)

2. Configuration File

ApplicationContext, xml (beans. xml)

(Data source, LocalSessionFactoryBean, Transaction Manager, transaction notification, AOP aspect, component scan, and annotation Support)

Struts. xml

3. web. xml

Struts2 Filter

<Filter>

<Filter-name> action </filter-name>

<Filter-class> org. apache. struts2.dispatcher. ng. filter. StrutsPrepareAndExecuteFilter

</Filter-class>

</Filter>

Spring listener contextConfigLocation

<Context-param>

<Param-name> contextConfigLocation </param-name>

<Param-value> classpath: beans. xml </param-value>

</Context-param>

<! -- Configure the context loading listener of the spring framework -->

<Listener>

<Listener-class> org. springframework. web. context. ContextLoaderListener

</Listener-class>

</Listener>

 

Data Source Configuration:

<Bean id = "dataSource" class = "com. mchange. v2.c3p0. ComboPooledDataSource">

<Property name = "driverClass" value = "$ {driverClass}"> </property>

<Property name = "jdbcUrl" value = "$ {jdbcUrl}"> </property>

<Property name = "user" value = "$ {user}"> </property>

<Property name = "password" value = "$ {password}"> </property>

<Property name = "initialPoolSize" value = "$ {initialPoolSize}"> </property>

<Property name = "maxPoolSize" value = "$ {maxPoolSize}"> </property>

<Property name = "minPoolSize" value = "$ {minPoolSize}"> </property>

</Bean>

Jdbc. properties

MySQL:

DriverClass = com. mysql. jdbc. Driver

JdbcUrl = jdbc: mysql: // localhost: 3306/Database Name

User = root

Password = root

InitialPoolSize = 30

MaxPoolSize = 50

MinPoolSize = 30

SqlServer:

Jdbc. driverClassName = net. sourceforge. jtds. jdbc. Driver

Jdbc. url = jdbc: jtds: sqlserver: // localhost: 1433/Data name

Jdbc. username = sa

Jdbc. password = abc123

InitialPoolSize = 30

MaxPoolSize = 50

MinPoolSize = 30

Oracle:

Jdbc. driverClassName = oracle. jdbc. driver. OracleDriver

Jdbc. url = jdbc: orcale: thin: // localhost: 1521/Database Name

Jdbc. username = wapcms

Jdbc. password = wapcms

 


How to build an ssh framework in eclipse?

Hi.baidu.com/...49df16

Although the link contains the ssh2 framework project built with MyEclipse, in the same way, add the corresponding configuration file and jar to the new project.

This example is suitable for Eclipse.

How to build an ssh Architecture

I recently reviewed how to build the SSH framework. 1. Set up myeclipse. 1. Add spring support. Right-click "MyEclipse -- AddSpring..." in the project and select "AOPCoreWeb" among the three libraries. The next step is complete. 2. Added hibernate support. First, open the myeclipsehibernate view to establish a database connection. Establish different database connections based on different data drivers. MyEclipse -- addhib.pdf... -- step by step as needed. 3. Added struts support. Then in the web. the context-paramparam-namecontexConfigLocation/param-nameparam-value/WEB-INF/applicationContext in the xml file. xml/param-value/context-paramlistenerlistener-classorg.springframework.web.context.ContextLoaderListener/listener-class/listener then controllerprocessorClass = org In the struts-config.xml. springframework. web. struts. delegatingRequestProcessor/controller when the project is loaded, an error indicating that the pool package is correct is returned. Then add it to the build path. At this time, the framework is basically set up. Step 1. Import the driver package. Struts, spring, and hibernate packages and database connection driver packages. 2. Configure the xml file. 3. Add the struts-config.xml file which involves referencing the dtd file 4. Add the applicationContext. xml file to the embryo file. (1. Connection. 2sessionfactory3. If the connection character is written in the property file, the bean connected to the property file must be configured.) 5. The hibernate plug-in is used for object ing. (Note that the table must have a primary key. Otherwise, the generated xml file is incorrect .) 6. Write dao class biz class action and other 7 to write JSP files. You must be familiar with the configuration of the three configuration files when using eclipse. (Web. xml, struts-config.xml, applicationContext. xml) Sorry, the above, hope to help you

Related Article

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.