Hello.jsp:<%@ 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=UTF-8"%>
<html:html> 
<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>以下是formbean:package formbean;import java.util.ArrayList;import javax.servlet.http.HttpServletRequest;import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;public class HelloForm extends ActionForm{

private String userName; public HelloForm() 
{
this.userName = "";
}

public String getUserName() {
return userName;
} public void setUserName(String userName) {
this.userName = userName;
}
/**
 * Reset all properties to their default values
 */
public void reset(ActionMapping mapping,HttpServletRequest request){
this.userName =userName;
}

/**
 * 
 */
public ActionErrors validate(ActionMapping mapping,HttpServletRequest request){
ActionErrors errors = new ActionErrors();
if((userName == null)|| userName.length()<1){
errors.add("userName",new ActionMessage("hello.no.username.error"));
return errors;
}
return errors;
}
}以下是PersonBean :
package bean;public class PersonBean {
private String userName;

public PersonBean(){

this.userName = "";
} public String getUserName() {
return userName;
} public void setUserName(String userName) {
this.userName = userName;
}
}
出现异常:
HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause java.lang.NullPointerException
org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:1219)
org.apache.struts.taglib.TagUtils.message(TagUtils.java:1082)
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:226)
org.apache.jsp.hello_jsp._jspx_meth_bean_message_0(hello_jsp.java:166)
org.apache.jsp.hello_jsp._jspx_meth_html_html_0(hello_jsp.java:118)
org.apache.jsp.hello_jsp._jspService(hello_jsp.java:90)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
--------------------------------------------------------------------------------Apache Tomcat/5.0.28跪求各位大虾!!!!!!!!!!!!!!!!!!!!!!本人在线等待

解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【magicians】截止到2008-07-18 13:25:49的历史汇总数据(不包括此帖):
    发帖的总数量:2                        发帖的总分数:0                        每贴平均分数:0                        
    回帖的总数量:0                        得分贴总数量:0                        回帖的得分率:0%                       
    结贴的总数量:0                        结贴的总分数:0                        
    无满意结贴数:0                        无满意结贴分:0                        
    未结的帖子数:2                        未结的总分数:0                        
    结贴的百分比:0.00  %               结分的百分比:---------------------
    无满意结贴率:---------------------无满意结分率:---------------------
    如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html
      

  2.   

    org.apache.jsp.hello_jsp._jspx_meth_bean_message_0(hello_jsp.java:166)
    org.apache.jsp.hello_jsp._jspx_meth_html_html_0(hello_jsp.java:118)
    org.apache.jsp.hello_jsp._jspService(hello_jsp.java:90) 你的i18n文件有问题,没找到你的i18n文件
      

  3.   

    tomcat 的 扎包
    tomcat-i18n-ja.jar
    tomcat-i18n-fr.jar
    tomcat-i18n-es.jar
      

  4.   

    我还有点迷茫,那么
    tomcat 的
    tomcat-i18n-ja.jar 
    tomcat-i18n-fr.jar 
    tomcat-i18n-es.jar怎么才能到的i18n文件呢???
      

  5.   

    工程 Properties for ** => Add External JARs.. => tomcat *.*/lib / * i18n-*.jar