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

资源文件配置有关问题,最后这么点分了

2013-09-11 
资源文件配置问题,最后这么点分了小弟初涉jsp的内容,下面这个问题请大家给点意见我使用的是tomcat5.5+ecli

资源文件配置问题,最后这么点分了
小弟初涉jsp的内容,下面这个问题请大家给点意见

我使用的是   tomcat5.5+eclipse3.2开发
项目是在windows下面做的,并且完全正常,然后移植到linux下面就出问题了

===========================================

HTTP   Status   500   -

type   Exception   report

message

description   The   server   encountered   an   internal   error   ()   that   prevented   it   from   fulfilling   this   request.

exception

org.apache.jasper.JasperException
        org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root   cause

java.lang.NullPointerException
        org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:1238)
        org.apache.struts.taglib.TagUtils.message(TagUtils.java:1101)
        org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:224)
        org.apache.jsp.login_jsp._jspx_meth_bean_message_0(login_jsp.java:161)
        org.apache.jsp.login_jsp._jspService(login_jsp.java:75)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

note   The   full   stack   trace   of   the   root   cause   is   available   in   the   Apache   Tomcat/5.5.23   logs.

===========================================

这个好象是说在使用标签的时候,资源文件出了问题,下面是
web.xml------------------------------------------------
<?xml   version= "1.0 "   encoding= "ISO-8859-1 "?>

<!DOCTYPE   web-app
    PUBLIC   "-//Sun   Microsystems,   Inc.//DTD   Web   Application   2.3//EN "
    "http://java.sun.com/dtd/web-app_2_3.dtd ">

<web-app>

    <!--   Action   Servlet   Configuration   -->
    <servlet>
        <servlet-name> actionServlet </servlet-name>
        <servlet-class> org.apache.struts.action.ActionServlet </servlet-class>
        <load-on-startup> 1 </load-on-startup>
    </servlet>

    <!--   Action   Servlet   Mapping   -->
    <servlet-mapping>
        <servlet-name> actionServlet </servlet-name>
        <url-pattern> *.do </url-pattern>
    </servlet-mapping>



    <!--   The   Welcome   File   List   -->
    <welcome-file-list>
        <welcome-file> login.jsp </welcome-file>
    </welcome-file-list>
   

    <!--   Struts   Tag   Library   Descriptors   -->
    <taglib>
<taglib-uri> /WEB-INF/struts-bean.tld </taglib-uri>
<taglib-location> /WEB-INF/struts-bean.tld </taglib-location>
    </taglib>    

    <taglib>
<taglib-uri> /WEB-INF/struts-html.tld </taglib-uri>
<taglib-location> /WEB-INF/struts-html.tld </taglib-location>
    </taglib>
   
    <resource-ref>
        <description> DB   Connection   </description>
        <res-ref-name> jdbc/mysql </res-ref-name>
        <res-type> javax.sql.DataSource </res-type>
        <res-auth> Container </res-auth>
  </resource-ref>
   
</web-app>

struts-config---------------------------------------
<?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= "LoginForm "   type= "actionform.LoginForm "/>
<form-bean   name= "SearchForm "   type= "actionform.SearchForm "/>
<form-bean   name= "AppointPageForm "   type= "actionform.AppointPageForm "/>
<form-bean   name= "ChannelSettingsForm "   type= "actionform.ChannelSettingsForm "/>

</form-beans>

<global-forwards>
<forward   name= "toError "   path= "/error.jsp "/>
<forward   name= "toMain "   path= "/main.jsp "/>
<forward   name= "logout "   path= "/login.jsp "/>
<forward   name= "toState "   path= "/state.jsp "/>
<forward   name= "toLoginError "   path= "/loginerror.jsp "/>
<forward   name= "toMessage "   path= "/showmessage.jsp "/>
<forward   name= "toRunlog "   path= "/runlog.jsp "/>
<forward   name= "toLogContent "   path= "/runlogcontent.jsp "/>
<forward   name= "toRecordData "   path= "/recorddata.jsp "/>
<forward   name= "toRecordIndex "   path= "/recordindex.jsp "/>
<forward   name= "toChannelSettings "   path= "/channelsettings.jsp "/>

</global-forwards>

<action-mappings>
<action   path= "/login "   type= "actions.LoginAction "   name= "LoginForm "   scope= "request "   validate= "true "   input= "/loginerror.jsp "/>
<action   path= "/searchrecord "   type= "actions.SearchRecordAction "   name= "SearchForm "   scope= "request "   validate= "false "   input= "/showmessage.jsp "/>


<action   path= "/gotoappointpage "   type= "actions.ShowAppointPageRecordDataAction "   name= "AppointPageForm "   scope= "request "   validate= "false "   input= "/showmessage.jsp "/>
<action   path= "/savechannelsettings "   type= "actions.SaveChannelSettingsAction "     name= "ChannelSettingsForm "   scope= "request "   validate= "false "   input= "/showmessage.jsp "/>

<action   path= "/startup "   type= "actions.StartupAction "   input= "/showmessage.jsp "/>
<action   path= "/shutdown "   type= "actions.ShutDownAction "   input= "/showmessage.jsp "/>
<action   path= "/logout "   type= "actions.LogoutAction "   input= "/showmessage.jsp "/>
<action   path= "/showrunlog "   type= "actions.ShowRunlogAction "   input= "/showmessage.jsp "/>
<action   path= "/deletelog "   type= "actions.DeleteRunlogAction "   input= "/showmessage.jsp "/>
<action   path= "/refreshlog "   type= "actions.RefreshRunlogAction "   input= "/showmessage.jsp "/>
<action   path= "/showchannelcurrentstate "   type= "actions.ShowChannelCurrentStateAction "   input= "/showmessage.jsp "/>
<action   path= "/showallrecord "   type= "actions.ShowAllRecordAction "   input= "/showmessage.jsp "/>
<action   path= "/refreshrecord "   type= "actions.RefreshRecordAction "   input= "/showmessage.jsp "/>
<action   path= "/gotopreviouspage "   type= "actions.ShowPreviousPageRecordDataAction "   input= "/showmessage.jsp "/>
<action   path= "/gotonextpage "   type= "actions.ShowNextPageRecordDataAction "   input= "/showmessage.jsp "/>
<action   path= "/showchannelsettings "   type= "actions.ShowChannelSettingsAction "   input= "/showmessage.jsp "/>
<action   path= "/deleteselectedrecord "   type= "actions.DeleteSelectedRecord "   input= "/showmessage.jsp "/>

</action-mappings>

<message-resources   parameter= "resources.MyResource "/>

</struts-config>

大家看看有什么问题,我是把整个工程都直接copy过去的
/src/resources/MyResource.properties
/classes/resources/MyResource.properties
都是存在的,开始以为是大小写的问题,修改之后还是不行,请高手指点一下

[解决办法]
我觉得应该是使用struts标签库中标签出的问题,但是到底是哪个看不出来.你可以把页面上的那些标签都去掉,把标签引入那两行也去掉.然后看看好使不?好使的话就是那些标签的问题了.
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html

热点排行