第一范文网 - 专业文章范例文档资料分享平台

MyEclipse8.6版的SSH实验

来源:用户分享 时间:2025/5/30 10:25:56 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

struts.url.includeParams = get

struts.custom.i18n.resources=messageResource struts.dispatcher.parametersWorkaround = false

### See the StrutsBeanWrapper javadocs for more information struts.freemarker.wrapper.altMap=true struts.xslt.nocache=false

### A list of configuration files automatically loaded by Struts struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml

struts.mapper.alwaysSelectFullNamespace=false (3)

信息资源属性文件

// messageResource_zh_CN.properties

对应的ASCII码为:

loginPage=\登\录\页\面 errorPage=\错\误\页\面 succPage=\成\功\页\面

failTip=\对\不\起\,\您\不\能\登\录\!\用\户\名\或\密\码\错\误\!

succTip=\欢\迎\,${0},\您\已\经\登\录\! user=\用\户\名 sex=\性 \别 age=\年 \龄 birth=\生 \日 pass=\密 \码

login=\登\录 reset=\重\置

user.required=\用\户\名\必\须\输\入\! pass.required=\密\码\必\须\输\入\!

这里包含所有的国际资源编码,本实验是写了中文,大家也可以使用其他的语言。

3. 在Web.xml中配置Spring的IoC容器和Struts2的前台控制器 系统自动生成的web.xml为:

xmlns=\

xmlns:xsi=\ xsi:schemaLocation=\ http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\>

index.jsp

struts2

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

struts2 /*

其中url-pattern是在与struts2交互时确定的。

配置之后的web.xml为: //web.xml

xmlns=\

xmlns:xsi=\ xsi:schemaLocation=\ http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\>

index.jsp

>

contextConfigLocation

/WEB-INF/classes/applicationContext.xml

org.springframework.web.context.ContextLoaderListener

struts2

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

struts2 /*

encoding UTF-8

Struts.xml基本上分为三部分: (1) 上下文参数;

(2) Spring容器的Listener;

(3) 定义Struts2的FilterDispathcer的Filter。

4. 配置本项目的上下文环境

本实验把Hibernate的配置文件和Spring的配置文件整合,即全由Spring来管理。

// applicationContext.xml(请注意,此代码中包含连接数据库的用户名和密码信息,请根据实际情况加以修改)

系统自动产生的applicationContext.xml为: // applicationContext.xml

class=\>

org.hibernate.dialect.SQLServerDialect

class=\>

value=\>

value=\>

xmlns=\ xmlns:xsi=\ xmlns:p=\

xsi:schemaLocation=\

http://www.springframework.org/schema/beans/spring-beans-3.0.xsd\>

com/domain/Users.hbm.xml

系统自动产生的applicationContext.xml包含3部分: (1) 数据源dataSource的配置;

(2) 会话工厂sessionFactory的配置; (3) DAO UsersDAO的配置。

完整配置以后的applicationContext.xml

搜索更多关于: MyEclipse8.6版的SSH实验 的文档
MyEclipse8.6版的SSH实验.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c7afga6azrj7yqpp85nax_5.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top