懂J2EE的帮忙看一下啊!<%@ page language="java" pageEncoding="ISO-8859-1"%>

来源:百度知道 编辑:UC知道 时间:2024/05/15 01:20:12
用MYECLIPSE建立工程后,新建了一个JSP页面,TOMCAT却无法访问啊,但是要是一句话可以访问成功,要是做个表单就出错了!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 /
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.MyJsp_jsp._jspService(org.apache.jsp.MyJsp_jsp:84)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
j

如果没有看错是你的STRUTS-CONFIG.XML写的有问题~~查找哪里没有对应上action和mapping的映射,因为设置了mapping的返回,而返回又没映射到正确的路径,所以就报错了,Cannot retrieve mapping for action /*,我找到struts-config.xml,检查到path="SystemParameterMimeographPunishDocument"这里,发现少了个"/",改成这样path="/SystemParameterMimeographPunishDocument",

你用了struts,用了struts的标签,你要保证你的<html:form action="" method="post" focus="login">
中的action不能为空的,要写上这个在STRUTS-CONFIG.XML中配置好的action的path,而且还要看和action绑定的那个actionform中的属性是不是和你的表单中的属性一样

<html:form action="login" method="post">

html:form 标签action的值不能为空
你要指定你配置的一个action
以后记住
500就是空指针异常
404就是找不到页面

上面说的很清楚了