首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Exception >

struts中的org.apache.jasper.JasperException: Cannot find message resources

2014-01-26 
为什么出现org.apache.jasper.JasperException: Cannot find message resources under key org.apache.stru

为什么出现org.apache.jasper.JasperException: Cannot find message resources under key org.apache.struts.action.MESSAGE这个错误?
 
  jsp页面
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
  <html:html>
  <html:errors/>
  <body>
 
 
  <html:form action="/login" focus="userName">
  <table>
  <tr>
  <td>user Name:</td>
  <td><html:text property="userName"/></td>
  </tr>
  <tr>
  <td>password</td>
  <td><html:password property="password" redisplay="false"/></td>
  </tr>
  <tr>
  <td colspan="2" align="right"><html:submit property="submit" value="login"/></td>
  </tr>
  </table>
  </html:form>
  </body>
  </html:html>
  ------------------------------------------------------------------------
 
  Action类
  package com.struts;
 
  import java.io.IOException;
  import javax.servlet.RequestDispatcher;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import javax.servlet.http.HttpSession;
  import org.apache.struts.action.*;
 
  public class LoginAction extends Action{
  public ActionForward execute (ActionMapping mapping,ActionForm form,HttpServletRequest request,
      HttpServletResponse response) throws IOException,ServletException
  {
  String userName = ((LoginForm) form).getUserName();
  String password = ((LoginForm) form).getPassword();
  if (......)
  {
  return mapping.findForward("success");
  }
  else
  {
  ActionErrors errors = new ActionErrors();
  errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("error.login.failed"));
  saveErrors(request,errors);
  return (new ActionForward(mapping.getInput()));
  }
  }
 
  }
  ----------------------------------------------------------------
  struts-config.xml中
  <action-mappings>
  <action path="/login"
  type="com.javapro.LoginAction"
  name="loginForm"
  scope="request"
  validate="true"
  input="/login.jsp">
  <forward name="success" path="/mainMenu.jsp"/>
  </action>
  </action-mappings>
  -----------------------------------------------------------------
  web.xml中
  <init-param>
  <param-name>application</param-name>         

热点排行