struts2.0+springframework2.5+ibatis2.3 Perfect integration of user login and additions and deletions to the demo sample serialization. A

Source: Internet
Author: User
Tags serialization
It's OK today, I studied the new features of Spring2.5, and by the way I wrote a struts2.0+spring2.5+ibatis example of integration, now I share my learning results to everyone, before learning this better familiar with its previous version of the development, It may be difficult to understand if you are not familiar with the study.
Tools: Eclipse3.3
MyEclipse6.01
Tomcat6.0.10
Properties Editor Plugin
MSSQL2000
New project: Name ibatis-login New Database script:/* SQL Server SCRIPTS */if EXISTS (SELECT * from dbo.sysobjects where id = object_ ID (N ' [dbo].[ Users] and OBJECTPROPERTY (ID, N ' isusertable ') = 1)
drop table [dbo]. [Users]
Go CREATE TABLE [dbo]. [Users] (
[ID] [int] not NULL,
[Username] [varchar] (m) COLLATE chinese_prc_ci_as not NULL,
[Password] [varchar] (m) COLLATE chinese_prc_ci_as not NULL
) on [PRIMARY]
Go
Second, this time is not like the previous direct use of myeclipse can directly load the corresponding framework, because the current popular IDE does not integrate such a new framework technology, but also do not talk about what visualization, so we have to do it step-by-step. All right, now we're going to add the jar we need to the Web-inf/lib directory of the project, and load the package as shown below:

  


Third, we now start to create the corresponding package, this I will not have to say, the project has established the final directory structure as follows:

  

Four, now we have the basic content of the project has been created, and now we start to configure Web.xml, Web.xml files are configured as follows:
? XML version= "1.0" encoding= "UTF-8"?>
< Web-app Version = "2.4"
xmlns = "Http://java.sun.com/xml/ns/j2ee"
Xmlns:xsi = "Http://www.w3.org/2001/XMLSchema-instance"
Xsi:schemalocation = "Http://java.sun.com/xml/ns/j2ee
Http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd ">
< Welcome-file-list >
< Welcome-file > login.jsp </welcome-file >
</welcome-file-list >
< Context-param >
< Param-name ></Param-name >
< Param-value ></Param-value >
</Context-param >
< listener >
< Listener-class > Org.springframework.web.context.ContextLoaderListener </listener-class >
</Listener >
< filter >
< Filter-name > struts2 </filter-name >
< Filter-class > Org.apache.struts2.dispatcher.FilterDispatcher </filter-class >
</Filter >
< filter-mapping >
< Filter-name > struts2 </filter-name >
< Url-pattern >/* </url-pattern >
</filter-mapping >
</Web-app >
  

This project to the basic configuration to this has been completed, and today a bit tired, write it here, tomorrow we continue to write, if interested in the study of the friend can download the sample code First look, the specific download address is as follows:

Demo sample Download Address: struts2.0+spring2.5.1+ibatis2.3 Address: http://download.csdn.net/source/331581

If a friend prefers hibernate, I'll write a hibernate integration later, but let's take a look at my previous two integration examples of Hibernate methods, download the following address:

struts1.2+spring1.2+hibernate3.1 Consolidated user Login download Address: http://download.csdn.net/source/323772

struts2.0+spring2.0+hibernate3.1 Integrated user login and additions and deletions complete example: http://download.csdn.net/source/326113

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.