Spring2.5.Struts2.Ibatis development framework structures (b)

2011-05-24  来源:本站原创  分类:Development  人气:108 

datebase.error = \ u6570 \ u636e \ u5e93 \ u64cd \ u4f5c \ u9519 \ u8bef \ uff01 \ uff01 \ uff01

validCode_error = \ u9a8c \ u8bc1 \ u7801 \ u9519 \ u8bef \ uff01 \ uff01

retistSdk.error = \ u6ce8 \ u518cSDK \ u5931 \ u8d25 \ uff01 \ u8bf7 \ u68c0 \ u67e5 \ u5e8f \ u5217 \ u53f7 \ u548c \ u5bc6 \ u7801 \ uff01 \ uff01

retistSdk.success = \ u8f6f \ u4ef6SDK \ u6ce8 \ u518c \ u6210 \ u529f \ uff01 \ uff01 \ uff01

logoutSdk.success = \ u60a8 \ u5df2 \ u6210 \ u529f \ u6ce8 \ u9500SDK \ uff01 \ uff01

logoutSdk.error = \ u6ce8 \ u9500SDK \ u5931 \ u8d25 \ uff0c \ u68c0 \ u67e5 \ u7f51 \ u7edc \ u8fde \ u63a5 \ uff01 \ uff01 \ uff01

chargUp.error = \ u5145 \ u503c \ u5931 \ u8d25 \ uff0c \ u8bf7 \ u68c0 \ u67e5 \ u5361 \ u53f7 \ u548c \ u5bc6 \ u7801 \ uff01 \ uff01

sdkNotReg = \ u7cfb \ u7edfSDK \ u6ca1 \ u6709 \ u6ce8 \ u518c \ uff01 \ uff01 \ uff01 \ uff01

struts.messages.error.uploading = \ u6587 \ u4ef6 \ u65e0 \ u6cd5 \ u6b63 \ u5e38 \ u4e0a \ u4f20

struts.messages.error.file.too.large = \ u6587 \ u4ef6 \ u5927 \ u5c0f \ u8d85 \ u8fc7 \ u6700 \ u5927 \ u5141 \ u8bb8 \ u503c

struts.messages.error.content.type.not.allowed = \ u6587 \ u4ef6 \ u7c7b \ u578b \ u4e0d \ u5728 \ u4e0a \ u4f20 \ u6587 \ u4ef6 \ u5141 \ u8bb8 \ u7c7b \ u578b \ u4e2d

The final document is struts.xml the contents of the struts of the parameters of this file is the configuration file, refer to configuration elements:

<? Xml version = "1.0" encoding = "UTF-8"?>

<! DOCTYPE struts PUBLIC

"- / / Apache Software Foundation / / DTD Struts Configuration 2.0 / / EN"

"Http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>

<constant name="struts.i18n.encoding" value="UTF-8"> </ constant>

<package name="login" extends="struts-default">

<Action name = "login"

method = "login">

<result name="success"> / dev_test / login.jsp </ result>

</ Action>

</ Package>

<package name="ji_common" extends="json-default">

<interceptors>

<interceptor-stack name="myDefaultStack">

<interceptor-ref name="defaultStack" />

</ Interceptor-stack>

</ Interceptors>

<default-interceptor-ref name="myDefaultStack"> </ default-interceptor-ref>

<global-results>

<result name="error"> / pages / errorMessage.jsp </ result>

<result name="warn"> / pages / warnMessage.jsp </ result>

</ Global-results>

</ Package>

<include file="edu/xw/ji/action/dict/struts2_dict.xml" />

</ Struts>

Note that the above configuration file struts.xml two examples package, the package name for the login from the struts-default package is inherited, can not achieve the action to return json format, the latter ji_common package from the json-default inherited , and after all the procedures in the project developers to use their own written action returns to the json format results can be inherited from the ji_common package.

2.4 Adding iBATIS framework to the project

IBATIS to find the extracted compressed package ibatis-2.3.4.726 \ lib directory, copy the inside. Jar file to the project's WEB-INF/lib directory.

Add the database buffer pool framework 2.5

Copy the buffer pool in the framework of DBCP commons-dbcp-xxxjar files to WEB-INF/lib directory to the project, copy the DBCP framework of the work need to use common-pool-related items in the jar file to WEB-INF/lib directory to go, DBCP is configured in the project is to use them to spring, so the next series of work with the spring's configuration.

相关文章