java错误调试
HTTPStatus500------------------------------------------------------------------------...
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: An exception occurred processing JSP page /staff/input_staff.jsp at line 23
20: <div class="entry_title">
21: <h2>新增员工</h2>
22: </div>
23: <html:form action="/staff.do">
24: <div class="formitem">
25: <label>员工姓名:</label>
26: <html:text property="staffName"/><html:errors property="staffName"/>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot retrieve mapping for action /staff
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.staff.input_005fstaff_jsp._jspService(input_005fstaff_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
javax.servlet.jsp.JspException: Cannot retrieve mapping for action /staff
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:759)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
org.apache.jsp.staff.input_005fstaff_jsp._jspx_meth_html_005fform_005f0(input_005fstaff_jsp.java:113)
org.apache.jsp.staff.input_005fstaff_jsp._jspService(input_005fstaff_jsp.java:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.
刚学java出现这个错误怎回事啊?
``` 展开
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /staff/input_staff.jsp at line 23
20: <div class="entry_title">
21: <h2>新增员工</h2>
22: </div>
23: <html:form action="/staff.do">
24: <div class="formitem">
25: <label>员工姓名:</label>
26: <html:text property="staffName"/><html:errors property="staffName"/>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot retrieve mapping for action /staff
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.staff.input_005fstaff_jsp._jspService(input_005fstaff_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
javax.servlet.jsp.JspException: Cannot retrieve mapping for action /staff
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:759)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
org.apache.jsp.staff.input_005fstaff_jsp._jspx_meth_html_005fform_005f0(input_005fstaff_jsp.java:113)
org.apache.jsp.staff.input_005fstaff_jsp._jspService(input_005fstaff_jsp.java:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.
刚学java出现这个错误怎回事啊?
``` 展开
3个回答
展开全部
使用struts编程要一般注意:
1、ActionForm中的get、set方法与jsp的标签名称对应。且注意标签首字母的大小写。例如ActionForm中命名为getName,则在jsp中标签名称应该为“name”。
2、在struts-config.xml文件中要定义相关的form、action
3、运行环境中要放入struts的相关jar包
4、jsp开头要import struts的标签
5、web.xml中进行struts的相关servlet配置
估计你的问题在第三、第四点
1、ActionForm中的get、set方法与jsp的标签名称对应。且注意标签首字母的大小写。例如ActionForm中命名为getName,则在jsp中标签名称应该为“name”。
2、在struts-config.xml文件中要定义相关的form、action
3、运行环境中要放入struts的相关jar包
4、jsp开头要import struts的标签
5、web.xml中进行struts的相关servlet配置
估计你的问题在第三、第四点
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
首先标签用错……<html:form action="/staff.do"> 只有开,没有关的?</html:form>这个!!但这个不是主要问题
Cannot retrieve mapping for action /staff
- -刚学java怎么就用起struts标签了?自然报错……
报错的信息是找不到对应的action,action是啥?等你学了struts就知道了……所以……不要用struts标签就好了
<div class="entry_title">
<h2>新增员工</h2>
</div>
<form action="/staff.do">
<input type="text" name="staffname" />
<div class="formitem">
<label>员工姓名:</label>
</form>
最后那功能……无法使用,删除
<html:errors property="staffName"/>
Cannot retrieve mapping for action /staff
- -刚学java怎么就用起struts标签了?自然报错……
报错的信息是找不到对应的action,action是啥?等你学了struts就知道了……所以……不要用struts标签就好了
<div class="entry_title">
<h2>新增员工</h2>
</div>
<form action="/staff.do">
<input type="text" name="staffname" />
<div class="formitem">
<label>员工姓名:</label>
</form>
最后那功能……无法使用,删除
<html:errors property="staffName"/>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
javax.servlet.jsp.JspException: Cannot retrieve mapping for action /staff
没找到这个啊 /staff !
你理解了/staff 的作用吗,看看配置文件,及相应的action!注意路径什么的!
没找到这个啊 /staff !
你理解了/staff 的作用吗,看看配置文件,及相应的action!注意路径什么的!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询