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

100分跪求高手解答,多谢!(加急)

2013-09-11 
100分跪求高手解答,谢谢!(加急)我用的是tomcat5.0.29跑struts1.2程序,能找到文件,就是打开jsp是总是报错,

100分跪求高手解答,谢谢!(加急)
我用的是tomcat5.0.29跑struts1.2程序,能找到文件,就是打开jsp是总是报错,找不到:错误是

HTTP   Status   500   -  

--------------------------------------------

type   Exception   report

message  

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

exception  

javax.servlet.ServletException:   Cannot   retrieve   mapping   for   action   /createNumberAction
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:845)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:778)
org.apache.jsp.form.guess_jsp._jspService(guess_jsp.java:161)
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)


root   cause  

javax.servlet.jsp.JspException:   Cannot   retrieve   mapping   for   action   /createNumberAction
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:753)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
org.apache.jsp.form.guess_jsp._jspx_meth_html_form_0(guess_jsp.java:194)
org.apache.jsp.form.guess_jsp._jspService(guess_jsp.java:98)
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.29   logs.

我的struts-config是:
<?xml   version= "1.0 "   encoding= "UTF-8 "?>
<!DOCTYPE   struts-config   PUBLIC   "-//Apache   Software   Foundation//DTD   Struts   Configuration   1.2//EN "   "http://struts.apache.org/dtds/struts-config_1_2.dtd ">

<struts-config>
    <data-sources   />
    <form-beans   >
        <form-bean   name= "createNumberForm "   type= "com.yourcompany.struts.form.CreateNumberForm "   />
        <form-bean   name= "judgeForm "   type= "com.yourcompany.struts.form.JudgeForm "   />

    </form-beans>

    <global-exceptions   />
    <global-forwards   />
    <action-mappings   >
        <action
            attribute= "createNumberForm "
            input= "/form/guess.jsp "
            name= "createNumberForm "
            path= "/createNumber "


            scope= "session "
            type= "com.yourcompany.struts.action.CreateNumberAction ">
            <forward   name= "guess "   path= "/form/guess.jsp "   />
        </action>
        <action
            attribute= "judgeForm "
            input= "/form/guess.jsp "
            name= "judgeForm "
            path= "/judge "
            scope= "session "
            type= "com.yourcompany.struts.action.JudgeAction ">
            <forward   name= "guess "   path= "/form/guess.jsp "   />
        </action>

    </action-mappings>

    <message-resources   parameter= "com.yourcompany.struts.ApplicationResources "   />
</struts-config>


[解决办法]
<action-mappings >
<action
attribute= "createNumberForm "
input= "/form/guess.jsp "
name= "createNumberForm " <---- 这里改成 name= "createNumberAction "
path= "/createNumber "
scope= "session "
type= "com.yourcompany.struts.action.CreateNumberAction ">
<forward name= "guess " path= "/form/guess.jsp " />
</action>
[解决办法]
path= "/createNumber " <---- 这里改成 path= "/createNumberAction "
赞同
[解决办法]
benny_good007 () ,path= "/createNumber " 改成 path= "/createNumberAction "没有用,path只是一个调用路径的别名,可以用你习惯用的任何名字,一般我们直接用XXXACTION名字,或者XXX就可,LZ可以用你的方式命名。建议你把work下生成的jsp类全部删掉,你的配置本身没有错。
[解决办法]
楼上强人...无语!
[解决办法]
这个错误提示是问题出在你的ACTION上,你可以从你的ACTION文件找问题,如果ACTION文件没问题,查看一下你的配置文件XML,如果正确则检查你的TOMCAT的SERVER.XML文件,最后检查你的ROOT目录和WORK目录
这是从你的错误提示出现的信息,你该查找的工作的方向
[解决办法]
同意楼上看法,按照struts的工作流程好好找一找。。
[解决办法]
<forward name= "guess " path= "/form/guess.jsp " />
检查一下这句话里 path有没有写对(/form/上一层是否还有文件夹),guess.jsp 是否可用
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html

热点排行