呵呵,沒看完
你把 struts-config.xml 配置中的:    <action path="/login" type="com.xxx.mailuser.web.LoginAction" name="loginForm" scope="request" input="/user/login.jsp" validate="true">
<forward name="success" path="/coremail/" /> validate="true" 改成  validate="false" 試一下    <action path="/login" type="com.xxx.mailuser.web.LoginAction" name="loginForm" scope="request" input="/user/login.jsp" validate="false">
<forward name="success" path="/coremail/" />

解决方案 »

  1.   

    一楼的试了不行
    二楼的是不是说 在struts中 设置encoding="UTF-8" ,我设置了,还用editplus用utf-8另存了
    还是不行怎么办?
    我第一次用struts
      

  2.   

    检查资源文件中是否已包含了你所用到的key
      

  3.   

    <%@ page contentType="text/html; charset=utf-8" language="java" errorPage="" %>
    <%@ page import="org.apache.struts.action.*, org.apache.struts.Globals" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %><%@ page contentType="text/html; charset=gb2312" language="java" errorPage="" %>
    <%@ page import="org.apache.struts.action.*, org.apache.struts.Globals" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
      

  4.   

    这个好象只有在jdk1.5版本下可以:
    errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("errors.login.userNameNotExist"));你用jdk1.42的话,应该这样来写:
    errors.add("显示错误的名字",new ActionError("errors.login.userNameNotExist"));
    我以前也试过,1.5以下的版本不能用ActionMessage来保存错误信息。
    建议你试一下!!!!!
      

  5.   

    这个validate一定不能设置为false,或者不设置也可,默认为true
        <action path="/login" type="com.xxx.mailuser.web.LoginAction" name="loginForm" scope="request" input="/user/login.jsp" validate="true">
    <forward name="success" path="/coremail/" />
      

  6.   

    改为如下试一下。
    <%      ActionErrors errors = new ActionErrors();
          errors.add("property1", new ActionError("property1message1"));
          request.setAttribute(Globals.ERROR_KEY, errors);
    %>
      

  7.   

    有个saveErrors()的函数,去看看,要加上这个就不用request.setAttribute了,不过原理都是一样的了
      

  8.   

    问题可能出现的原因:
    1、你的资源文件没有配置好。
    2、有些JDK只能用new ActionError("property1message1")来保存错误。
    3、你调用了
    saveErrors(errors,request)或request.setAttribute(“error”,errors)方法没有。