
Struts1
文章平均质量分 80
gemini18
这个作者很懒,什么都没留下…
展开
-
Struts下的国际化
在web的根目录下建一个包用于放资源文件:ApplicationResources.propertiesApplicationResources_en_US.propertiesApplicationResources_zh_CN.propertiesApplicationResources_en_US.properties 中的代码 button_submit=submit ...2007-01-08 23:24:05 · 77 阅读 · 0 评论 -
用Validator框架实现基本的表单验证
用Validator框架实现基本的表单验证,需要对ActionForm Bean、struts-config.xml、validation.xml、资源文件、JSP进行改动,例子:★ ActionForm Bean如果要使用Validator框架,应该用ValidatorForm或DynaValidatorForm或它们的子类。★ struts-config.xml <s...2007-01-21 02:55:00 · 158 阅读 · 0 评论 -
Struts1报错信息汇总(不断更新中)
★ Servlet action is not available在WEB容器正常启动的前提下,当提交请求到Action时,出现此错误页面,一般主要检查web.xml、struts-config.xml。★ Cannot find bean under name org.apache.struts.taglib.html.BEAN在html:form标签外使用了html:form的子元素标签...2007-01-25 13:10:12 · 145 阅读 · 0 评论 -
关联CSS到Struts JSP页面中
结合使用struts-config.xml的global-forwards和Struts JSP的html:rewrite标签。假设mystyle.css在WEB根目录下的css目录里,在struts-config.xml文件中,创建一个global forward: <global-forwards> <forward name="mySt...2007-03-04 22:56:00 · 105 阅读 · 0 评论 -
Struts源码学习 — ActionServlet的初始化
Struts版本:1.2.9ActionServlet的初始化由org.apache.struts.action.ActionServlet类的init()方法实现,代码如下:/** * Initialize this servlet. Most of the processing has been factored into * support methods so th...2007-12-27 11:19:11 · 209 阅读 · 0 评论 -
Struts使用BeanUtils提供的数据类型转换器
Struts版本——1.2.9BeanUtils版本——1.7.0 在使用Struts开发的应用中,当请求转交到Action时,如果有关联这个Action的ActionForm,Struts会用请求参数填充ActionForm里相应的字段。由于ActionForm字段的数据类型是在应用运行前写死的,请求参数是在应用运行后才能确定的,所以它们之间存在数据类型转换的问题。Struts在用...2007-12-30 01:27:46 · 136 阅读 · 0 评论 -
Struts源码学习 — 初始化ModuleConfig
Struts版本——1.2.9Digester版本——1.6 初始化ModuleConfig就是指Struts将struts-config.xml初始化为ModuleConfig对象,实现这个动作的代码在ActionServlet的init()方法中,如下: initModuleConfigFactory(); // Initialize ...2008-01-05 17:08:21 · 873 阅读 · 0 评论 -
Struts处理请求全过程
在用Struts开发的Web应用中,我们主要编写Action类来处理到来的请求,但请求到达Action之前,Struts为我们做了很多工作。Struts使用ActionServlet统一处理所有到来的请求,每到来一个请求,它都要做很多事情,执行我们编写的Action只是其中之一,Struts处理请求的过程如下: 1. 选择模块根据请求URL和应用的所有模块名(这个模块名的集合在ActionSe...2008-02-20 23:13:18 · 339 阅读 · 0 评论