You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by s-sbergg <s-...@haw-landshut.de> on 2018/10/10 03:33:10 UTC

The Struts dispatcher cannot be found.

Hello,
Struts version 2.5.17

I am trying to setup struts 2 on tomcat, but there is coming up an 
error. The .jsp was opened directly. If there are more files needed to 
figure out what is wrong, feel free to ask.

Error-message:

HTTP Status 500 – Internal Server Error

Type Exception Report

Message An exception occurred processing JSP page /web/welcome.jsp at 
line 15

Description The server encountered an unexpected condition that 
prevented it from fulfilling the request.

Exception

org.apache.jasper.JasperException: An exception occurred processing JSP 
page /web/welcome.jsp at line 15

12:     <title>Welcome</title>
13: </head>
14: <body>
15: Hello User: <s:property value="name"/>
16: </body>
17: </html>


Stacktrace:
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:594)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:491)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Root Cause

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.struts2.views.jsp.TagUtils.getStack(TagUtils.java:53)
	org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:40)
	org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:45)
	org.apache.jsp.web.welcome_jsp._jspx_meth_s_005fproperty_005f0(welcome_jsp.java:131)
	org.apache.jsp.web.welcome_jsp._jspService(welcome_jsp.java:95)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:453)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="my" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
          version="4.0">

     <display-name>Archetype Created Web Application</display-name>
     <filter>
         <filter-name>struts2</filter-name>
         
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
     </filter>
     <filter-mapping>
         <filter-name>struts2</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
     <jsp-config>
         <taglib>
             <taglib-uri>struts-tags.tld</taglib-uri>
             
<taglib-location>/WEB-INF/lib/struts2-core.jar</taglib-location>
         </taglib>
     </jsp-config>
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
     </welcome-file-list>
</web-app>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: The Struts dispatcher cannot be found.

Posted by si...@gmail.com, si...@gmail.com.
Thanks for your help. Using archetypes was a good approach. I used an archetype in IntelliJ. You can find them under New Project --> Maven --> Create from archetype. Mentioning on the 'Get Startet-Page' that you can use archetypes (=prebuild working examples) in your IDE would be very helpful. At least I think so.

Regards
Simeon

On 2018/10/10 06:09:36, Lukasz Lenart <lu...@apache.org> wrote: 
> Do you use Maven? If so you can try to start with our archetypes
> https://struts.apache.org/maven-archetypes/
> 
> śr., 10 paź 2018 o 07:35 s-sbergg <s-...@haw-landshut.de> napisał(a):
> > Message An exception occurred processing JSP page /web/welcome.jsp at
> > line 15
> 
> Do you access this JSP directly or via an action?
> 
> >      <jsp-config>
> >          <taglib>
> >              <taglib-uri>struts-tags.tld</taglib-uri>
> >
> > <taglib-location>/WEB-INF/lib/struts2-core.jar</taglib-location>
> >          </taglib>
> >      </jsp-config>
> 
> You do not need this.
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: The Struts dispatcher cannot be found.

Posted by Lukasz Lenart <lu...@apache.org>.
Do you use Maven? If so you can try to start with our archetypes
https://struts.apache.org/maven-archetypes/

śr., 10 paź 2018 o 07:35 s-sbergg <s-...@haw-landshut.de> napisał(a):
> Message An exception occurred processing JSP page /web/welcome.jsp at
> line 15

Do you access this JSP directly or via an action?

>      <jsp-config>
>          <taglib>
>              <taglib-uri>struts-tags.tld</taglib-uri>
>
> <taglib-location>/WEB-INF/lib/struts2-core.jar</taglib-location>
>          </taglib>
>      </jsp-config>

You do not need this.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org