- 浏览: 18509 次
最新评论
public class UserForm extends ActionForm {
@Override
public ActionErrors validate(ActionMapping mapping,HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
String name1 = user.getUsername();
if(name1 != null)
name1 = name1.trim();
if("".equals(name1))
errors.add("username", new ActionMessage("error.username"));
return errors;
}
}
.................
</action-mappings>
<message-resources parameter="cn.user.strutsdemo.application.Application"></message-resources>
<message-resources parameter="cn.user.strutsdemo.application.Application" key="XXX"></message-resources>
(jsp画面对应的这个资源包里显示形式为:
<title><bean:message key="info.title" bundle="XXX"/></title>)
<html:errors bundle="XXX" />
</struts-config>
Application.properties里面中文以unicode码形式保存
Application_en.properties
Application_zh_CN.properties
Application.properties
画面<html:errors/>表示
<html>标签里面不可以再套标签(即标签里面属性值不能也是标签):
<html:submit><bean:message key='info.submit'/></html:submit>
但<input>标签中可以套标签使用:
<input type="submit" value="<bean:message key='info.submit'/>" />
@Override
public ActionErrors validate(ActionMapping mapping,HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
String name1 = user.getUsername();
if(name1 != null)
name1 = name1.trim();
if("".equals(name1))
errors.add("username", new ActionMessage("error.username"));
return errors;
}
}
.................
</action-mappings>
<message-resources parameter="cn.user.strutsdemo.application.Application"></message-resources>
<message-resources parameter="cn.user.strutsdemo.application.Application" key="XXX"></message-resources>
(jsp画面对应的这个资源包里显示形式为:
<title><bean:message key="info.title" bundle="XXX"/></title>)
<html:errors bundle="XXX" />
</struts-config>
Application.properties里面中文以unicode码形式保存
Application_en.properties
Application_zh_CN.properties
Application.properties
画面<html:errors/>表示
<html>标签里面不可以再套标签(即标签里面属性值不能也是标签):
<html:submit><bean:message key='info.submit'/></html:submit>
但<input>标签中可以套标签使用:
<input type="submit" value="<bean:message key='info.submit'/>" />
发表评论
-
<html:link> <html:rewrite>区别
2011-11-20 22:13 880<html:link> 生成的是一个超链接: &l ... -
<htmk:link>的使用
2011-11-20 21:56 735<html:link action="/Reg ... -
struts中的整数转换器问题
2011-10-12 23:13 0画面入力项显示的是"",点击提交按钮后也显 ... -
防止表单重复提交的原理与struts的实现
2011-10-10 06:59 594第一个action: public class RegUser ... -
<html:checkbox>标签使用时要重写reset方法
2011-10-09 22:24 1084<html:checkbox property=&quo ... -
errors参数国际化
2011-10-09 07:21 518prompt.name=(en)username error. ... -
表单校验和业务逻辑校验
2011-10-09 06:53 999表单校验:请求参数->ActionForm->Ac ... -
html_errors标签单独显示各个错误消息
2011-10-08 22:00 1204public class UserForm extends A ... -
FormBean使用值对象类型的属性
2011-10-06 20:54 877public class UserForm extends A ... -
<logic:forward>与<logic:redirect>区别
2011-09-29 23:11 15171 .<logic:forward>属于程序内部访 ... -
<htmk:forward>对应在struts-config.xml中应配置全局的forward
2011-09-29 22:34 712当你想访问http://localhost:9999/stru ... -
<htmk:link>自动生成sessionId,支持url重写
2011-09-29 07:11 712当客户端向服务器发送一请求时,服务器不知道客户端是否支持coo ... -
防止struts-config.xml文件膨胀_OtherActionForm.java
2011-09-29 22:34 558public class OtherActionForm ex ... -
防止struts-config.xml文件膨胀_LoginOtherAction.java
2011-09-27 22:13 610public class LoginOtherAction e ... -
防止struts-config.xml文件膨胀_hello.jsp
2011-09-27 22:12 628<%@ page contentType="t ... -
防止struts-config.xml文件膨胀_struts-config.xml
2011-09-27 22:10 448<?xml version="1.0" ...
相关推荐
cfg_errors.gocfg_errors.gocfg_errors.gocfg_errors.gocfg_errors.gocfg_errors.gocfg_errors.gocfg_errors.gocfg_errors.gocfg_errors.go
oracle8i_errors.chm
python库。 资源全名:pretty_errors-1.0.7-py3-none-any.whl
max_connect_errors是一个MySQL中与安全有关的计数器值,它负责阻止过多尝试失败的客户端以防止暴力破解密码的情况。max_connect_errors的值与性能并无太大关系。 默认情况下,my.cnf文件中可能没有此行,如果需要...
How_to_avoid_common_errors_and_make_program_efficient[1][1]..pdf
ADS_Errors_and_Warnings,ADS编译错误和警告详细说明
11-6_cal_errors.py
RVCT 2.0_Errors_and_Warnings,ARM编译过程的错误官方说明文档
Exploiting_Errors_in_Windows_Error_Reporting web安全 移动安全 安全体系 安全测试 安全建设
Oracle_Errors描述包括了ORACAL常见错误信息列表
Oracle_Errors(oracle错误信息)解释
Best_Errors和 :终于在一起了! 是否厌倦了为每个Rails 项目在 Gemfile 中同时要求better_errors和binding_of_caller而使您的手指陷入僵局? 那么这颗宝石是给你的!安装把它放在你的 Gemfile 中并打包: gem 'best...
Rocks automatic partitioning errors The following errors occurred with your partitioning: You have not defined a root partition which is required for installation of Rocks to continue You have not ...
python库。 资源全名:gtki_module_orup_errors-1.23-py3-none-any.whl
资源来自pypi官网。 资源全名:pretty_errors-1.0.3.tar.gz
Oracle_Errors oracle错误大全 学习oracle必备工具 学习oracle的利器
robust synchronisation errors
Oracle SQL语法速查&Oracle_Errors.rar 包括了Oralce的SQL语法和错误查询
资源分类:Python库 所属语言:Python 资源全名:musamusa_errors-0.9.4.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059