资源文件确定没问题?
有这一项jsp.hello.errors?
有这一项jsp.hello.errors?
解决方案 »
- applet问题--解决问题立即给分,急
- java.sql.SQLEcxeption:[Oracke][ODBC][Ora]ORA-12514:TNS:监听程序当前无法识别连接描述符中请求的服务
- struts-config 数据源配置问题
- 一个去掉重复的问题
- 关于JBuilder中weblogic pletform Server 8.x配置问题 (在线等)
- 问个有关dbcp中BasicDataSource的问题。
- 有没有好的ejb+jsp+数据库的好的例子呢?
- 现有需求:两个关联表A,B。当A中插入一条记录时,在B中插入多条记录,同时将A中的主键插入B中,如果B中插入操作失败时,A表回滚。在EJB
- 为什么不能在ejb中调用另一台主机上的ejb
- w10系统如何连接access数据库
- 用struts的role做细粒度的权限控制系统
- msq 设置默认值问题
这回看看
saveErrors(arg2, errors);
saveErrors(request, errors);
import org.apache.struts.action.ActionErrors;public final class xxx extends Action {public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
LoginsForm loginsForm = (LoginsForm) form;// TODO Auto-generated method stub
ActionErrors errors=new ActionErrors();
if((loginsForm.getUsername()==null) ¦ ¦(loginsForm.getUsername().length() <1)){
ActionError error=new ActionError("error.missing.username");
errors.add(ActionErrors.GLOBAL_ERROR,error);
}
session.setAttribute("username", username);
return mapping.findForward("success");
}
} }
jsp
<html:errors/>
<html:form action="/xxxx.do">
xxxxxxxxxxxxxxx
</html:form>ApplicationResource.properties文件
#Application Resource for the xxx.java
error.missing.username=<li><font color="red">error</font></li>