简体   繁体   English

找不到Struts调度程序

[英]The Struts dispatcher cannot be found

I could found an error in my code,kindly help me what mistake i have done below. 我可以在代码中发现错误,请在下面帮助我。

Build.xml Build.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">
    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <welcome-file-list>
        <welcome-file>/index.jsp</welcome-file>
    </welcome-file-list>
</web-app>

index.jsp index.jsp

<s:form action="verify">

    <s:textfield name="uname" label="Enter Username"/>
    <s:textfield name="pass" label="Enter the Password"/>

    <s:submit value="Click" align="center" />

</s:form>

Exception 例外

org.apache.jasper.JasperException: The 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.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

Place web.xml file under WEB-INF folder. 将web.xml文件放在WEB-INF文件夹下。 I was also facing the same problem but placing the web.xml file in correct place resolved the issue. 我也遇到了同样的问题,但是将web.xml文件放在正确的位置解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到Struts调度程序 - Struts dispatcher cannot be found Struts错误:无法找到Struts调度程序 - Struts Error: The Struts dispatcher cannot be found Struts-异常-找不到Struts调度程序 - Struts - Exception - The Struts dispatcher cannot be found 在struts2中找不到Struts调度程序 - The Struts dispatcher cannot be found in struts2 部署时找不到Struts调度程序 - The Struts dispatcher cannot be found while deploy 异常处理ErrorPage。找不到Struts调度程序.org.apache.jasper.JasperException:找不到Struts调度程序 - Exception Processing ErrorPage .The Struts dispatcher cannot be found.org.apache.jasper.JasperException: The Struts dispatcher cannot be found 在 WebLogic 12.1.3 上部署应用程序时出现“找不到 Struts 调度程序”错误 - "The Struts dispatcher cannot be found" error while deploying application on WebLogic 12.1.3 struts 2调度程序和tomcat 6安全性 - struts 2 dispatcher and tomcat 6 security org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter 无法使用嵌入式 Tomcat 转换为 Struts 2 中的 javax.servlet.Filter - org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter cannot be cast to javax.servlet.Filter in Struts 2 using embedded Tomcat 分派器初始化因Struts2而失败 - Dispatcher initialization failed with Struts2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM