HTTP Status 500 -type Exception reportmessagedescription The server encountered an internal error () that prevented it from fulfilling this request.exceptionorg.apache.jasper.JasperException: Exception in JSP: /index.jsp:1714:   </head>
15:   
16:   <body>
17:     <s:form action="login">
18:     <s:textfield label="甯愬彿" name="name"></s:textfield>
19:     <s:password label="瀵嗙爜" name="passwrod"></s:password>
20:     <s:submit value="鎻愪氦"></s:submit>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:321)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:257)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root causeThe Struts dispatcher cannot be found.  This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]
org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:60)
org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:52)
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)
org.apache.jsp.index_jsp._jspx_meth_s_005fform_005f0(index_jsp.java:110)
org.apache.jsp.index_jsp._jspService(index_jsp.java:82)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:321)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:257)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.29 logs.Apache Tomcat/5.5.29jsp 页面源码:
<%@ page language="java" import="java.util.*" pageEncoding="utf8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
  </head>
  
  <body>
    <s:form action="login">
    <s:textfield label="帐号" name="name"></s:textfield>
    <s:password label="密码" name="passwrod"></s:password>
    <s:submit value="提交"></s:submit>
    </s:form>
  </body>
</html>
请遇到过类似的问题者,帮帮忙解决一下,不胜感激

解决方案 »

  1.   

    The Struts dispatcher cannot be found
    发下strut.xml文件配置
      

  2.   

    sturts.xml<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
    <package name="struts2" extends="struts-default">
    <action name="login" class="com.sz.login.acion.LoinAction">
    <result name="success">success.jsp</result>
    <result name="error">error.jsp</result>
    </action>
    </package>
    </struts>
      

  3.   


         web.xml   <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <init-param>
          <param-name>debug</param-name>
          <param-value>3</param-value>
        </init-param>
        <init-param>
          <param-name>detail</param-name>
          <param-value>3</param-value>
        </init-param>
        <load-on-startup>0</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
      </servlet-mapping>
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
    </web-app>
       兄弟,那个报错的地点你能复制给我看下吗?下次我就记住了?谢了
      

  4.   

    这个是strut1吧,你开着strut1,跑strut2的标签,你认为可以跑起来吗
      

  5.   


    <%@ taglib prefix="s" uri="/struts-tags" %>这句代码不是引进 struts 标签吗?
       
      

  6.   


        呵呵  真的不好意思,我 struts1 也不会 struts2 也初学,所以真的找不到错,
     我觉得是不是我添加 struts 的时候出问题了
      

  7.   

     <s:form action="login.do">
      <s:textfield label="帐号" name="name"></s:textfield>
      <s:password label="密码" name="passwrod"></s:password>
      <s:submit value="提交"></s:submit>
      </s:form>
      

  8.   

    你最好看下视频,如果你用的是MyEclipse8.5的话在选择加strut的时候注意选下版本是2.0的