<%@ page contentType = "text/html;charset = UTF-8" language = "java" %><%@ 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:html locale = "true">
  <head>
    <title><bean:message key="hello.jsp.title"/></title>
    <html:base/>
  </head>
  
  <body bgcolor="white"><p>
    <h2><bean:message key="hello.jsp.page.heading"/></h2><p>
    <html:errors/><p>
    
    <logic:present name="personbean" scope="request">
      <h2>
        <bean:message key="hello.jsp.page.hello"/>
        <bean:write name="personbean" property="userName"/>!<p>
      </h2>
    </logic:present>
    
    <html:form action="/HelloWorld.do" focus="userName">
      <bean:message key="hello.jsp.prompt.person"/>
      <html:text property="userName" size="16" maxlength="16"/><br>
      <html:submit property="submit" value="Submit"/>
      <html:reset/>
    </html:form><br>
  </body> </html:html>

解决方案 »

  1.   

    <?xml version = "1.0" encoding = "ISO-8859-1" ?><!DOCTYPE struts-config PUBLIC
      "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
      "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
      
      <struts-config>
        <form-beans>
          <form-bean name = "HelloForm" type = "hello.HelloForm" />
        </form-beans>
        
        <action-mapping>
          <action path = "/HelloWorld"
                  type = "hello.HelloAction"
                  name = "HelloForm"
                  scope = "request"
                  validate = "true"
                  input = "/hello.jsp"
          >
            <forward name = "SayHello" path = "/hello.jsp" />
          </action>
        </action-mapping>
        
        <message-resources parameter = "hello.application" />
      
      </struts-config>
      

  2.   

    <html:submit property="submit" value="Submit"/>
    这句咋看咋别扭。
    为什么要property="submit" value=""???
    改为以下内容<html:submit>保存</html:submit>
      

  3.   

    把message的东西都去掉试试,慢慢来
      

  4.   

    呵呵
    <html:submit property="submit" value="Submit"/>
    这个没问题。这个错误信息是说没有找到相应的message资源文件。
    看一下WEB-INF/classes/里面有没有hello.application.properties这个文件。
    要是有的话,再确认一下,文件里面有没有
    hello.jsp.title=XXX
    hello.jsp.page.heading=XXX
    等等所有用到的message key
      

  5.   

    你的actionform的setter方法没有被actionservlet调用过.请考虑你的jsp页面.可能是的property name 和actionform里的成员变量之间没有对应.所以没有找到.不相信的话,你可以在你的action里写上测试语句看看form.getter()得到的值是否为空.假如为空的话说明说的是真的.