0

I'm unable to compile JSP in Struts. I am getting JasperException at line 20. I have included all jars required to tackle taglib files.

17:<form action="/login.do?method=authUser" >
18:    <div align="center">
19:    <table>
20:        <tr><td><label>UserName</label></td><html:text property="username"/></tr>
21:        <tr><td><label>Password</label> </td><html:password property="passwd"/></tr>
22:    </table>
23:    <html:submit value="LogIn"/><html:submit value="SignUp" onclick="gotoSignuUp();"/>
24:</form>
4

1 回答 1

0

如果您看到此错误org.apache.jasper.JasperException: The Struts dispatcher cannot be found那么您的 web.xml 中可能缺少 struts 过滤器:

<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>

还要检查你的jsp中的struts html库

<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>

注意:如果您可以发布完整的错误代码,那么我们可以查明确切的问题并给出相应的解决方案。

于 2013-04-22T07:25:49.710 回答