配置有问题,如果要运行例子,直接扔到tomcat的webapps目录下就可以来。启动tomcat就可以看到了。

解决方案 »

  1.   

    你检查一下hello.jsp中37行这里(以及其他地方)是不是这里写错了:
    <bean:message key="test"/>,也就是说你把<bean:message key="test"/>写成了
    <bean:message key="test">,掉了一个“/”
    初学struts时,这个地方是很容易出错的
      

  2.   

    用向导生成的jsp吧,然后再敲例子,这样出错机会要少
      

  3.   

    不要写代码了,
    直接用她写的代码就行了!
    仔细分析不是更好!!如果需要代码可以联系我! [email protected]
      

  4.   

    <%@ page contentType="text/html; charset=GB2312" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <!--
    <html>
    <head>
    <title>
    hello
    </title>
    </head>
    <body bgcolor="#ffffff">
    <h1>
    JBuilder Generated JSP
    </h1>
    <form method="post" action="hello.jsp">
    <br><br>
    <input type="submit" name="Submit" value="Submit">
    <input type="reset" value="Reset">
    </form>
    </body>
    </html>
    -->
    <html:html locale="true">
      <head>
      <title>
      <bean:message key="hello.jsp.title"/>
      <html:base/>
      </title>
      </head>
      <body bgcolor="#ffffff">
      <br/>
      <bean:message key="hello.jsp.page.heading"/>
      <html:errors/>
      <br/>
      <logic:present name="personbean" scope="request">
      <bean:message key="hello.jsp.page.hello"/>
      <bean:write name="personbean" property="userName">
      </logic:present>
      <html:form method="post" action="/HelloWorld.do">    用户名:
        <html:text property="userName" size="16" maxlength="16"/><br/>
        密  码:
        <html:password property="password"  size="16" maxlength="16"/>
        <html:submit property="Submit" value="登录">
          <html:reset/>  </html:form>
      </body>
    </html:html>
    这是我的代码,没有写错呀?
    37行  <bean:message key="hello.jsp.page.hello"/>
      

  5.   

    刚才上面是代码有误
    <html:submit property="Submit" value="登录">
    没有斜杠,但是运行之后有有异常了,
    exception javax.servlet.ServletException: Missing message for key "hello.jsp.title"
     org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
     org.apache.jsp.hello_jsp._jspService(org.apache.jsp.hello_jsp:102)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)这是什么原因呢?是找不到application.properties吗?
      

  6.   

    检查一下application.properties 里面定义的一些key Missing message for key "hello.jsp.title
                                 |
                                 |
                                 V
    37行  <bean:message key="hello.jsp.page.hello"/>
      

  7.   

    ding
    有人遇到过这个问题吗?
      

  8.   

    不是清清楚楚写着嘛,exception javax.servlet.ServletException: Missing message for key "hello.jsp.title",要么是你资源文件里没写hello.jsp.title这个VALUE,或者WEB-INF/classes/下没有资源文件,在struts-config.xml里检查一下<message-resources parameter="yourPackageName.ApplicationResources" />
      

  9.   

    Missing message for key "hello.jsp.title",真的有了吗,看仔细点
      

  10.   

    乐乐,<message-resources parameter="yourPackageName.ApplicationResources" />是 这里错乐,是大小写写错了,顺便问个问题,ActionErrors和ActionMessages有什么区别?
      

  11.   

    ActionErrors是ActionMessages的子类,主要用于封装Validate()产生的错误信息,ActionMessages封装更多的信息,具体其他用法可以参见STRUCTS源码