I am using

http://struts.apache.org/release/2.3.x/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareFilter.html

then sitemesh, my own filter then

http://struts.apache.org/release/2.3.x/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsExecuteFilter.html

Isnt that the same as just using the one you proposed?

Also: Where do I put my OwnApplicationFilter? Before the StrutsPrepare, or afterwards?

Best
Fabian

Am 27.06.2013 05:14, schrieb vEnkaTa mohAna rAo SriperumbUdUru:
http://struts.apache.org/release/2.3.x/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/filter/StrutsPrepareAndExecuteFilter.html
try to point to this filter. Usually get the above message when you are
using struts2 tags in jsp trying to display and not passing through the
StrutsPrepareAndExecuteFilter filter.


On Wed, Jun 26, 2013 at 4:07 PM, Fabian Richter <frich...@mtg.de> wrote:

Hello all,

I am faily new with struts, and to get a grip on the mechanics I
volunteered to migrate one of our applications from Webwork to struts2
latest.

So far I made progress, the application is not only running but also
rendered some UI in the browser.

But I have exceptions like

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]
         at org.apache.struts2.views.jsp.**TagUtils.getStack(TagUtils.**
java:60)
         at org.apache.struts2.views.jsp.**StrutsBodyTagSupport.getStack(**
StrutsBodyTagSupport.java:44)
         at org.apache.struts2.views.jsp.**ComponentTagSupport.**
doStartTag(**ComponentTagSupport.java:48)

On every action I do on the website.

I am always calling actions (as far as I know) so no .jsp pages directly.

My web.xml looks like:

-------%< SNIP ------------

     <filter>
         <filter-name>appFilter</**filter-name>
         <filter-class>own.**ApplicationFilter</filter-**class>
     </filter>

     <filter>
         <filter-name>struts-prepare</**filter-name>

<filter-class>org.apache.**struts2.dispatcher.ng.filter.**
StrutsPrepareFilter</filter-**class>
     </filter>
     <filter>
         <filter-name>struts-execute</**filter-name>

<filter-class>org.apache.**struts2.dispatcher.ng.filter.**
StrutsExecuteFilter</filter-**class>
     </filter>

     <filter>
         <filter-name>sitemesh</filter-**name>

<filter-class>com.**opensymphony.sitemesh.webapp.**
SiteMeshFilter</filter-class>
     </filter>

     <filter-mapping>
         <filter-name>appFilter</**filter-name>
         <url-pattern>*.html</url-**pattern>
     </filter-mapping>

     <filter-mapping>
         <filter-name>struts-prepare</**filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>

     <filter-mapping>
         <filter-name>sitemesh</filter-**name>
         <url-pattern>/*</url-pattern>
         <dispatcher>REQUEST</**dispatcher>
         <dispatcher>FORWARD</**dispatcher>
         <dispatcher>INCLUDE</**dispatcher>
     </filter-mapping>

     <filter-mapping>
         <filter-name>struts-execute</**filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>

     <listener>
         <listener-class>own.**StartupListener</listener-**class>
     </listener>

     <listener>

<listener-class>org.apache.**struts2.dispatcher.ng.**
listener.StrutsListener</**listener-class>
     </listener>

     <listener>

<listener-class>org.**springframework.web.util.**
Log4jConfigListener</listener-**class>
     </listener>


     <servlet>
         <servlet-name>sitemesh-**freemarker</servlet-name>

<servlet-class>org.apache.**struts2.sitemesh.**
FreemarkerDecoratorServlet</**servlet-class>
         <init-param>
             <param-name>default_encoding</**param-name>
             <param-value>UTF-8</param-**value>
         </init-param>
         <load-on-startup>1</load-on-**startup>
     </servlet>

     <servlet-mapping>
         <servlet-name>sitemesh-**freemarker</servlet-name>
         <url-pattern>*.ftl</url-**pattern>
     </servlet-mapping>

     <servlet>
         <servlet-name>**JspSupportServlet</servlet-**name>

<servlet-class>org.apache.**struts2.views.**JspSupportServlet</servlet-**
class>
         <load-on-startup>1</load-on-**startup>
     </servlet>

-------%< SNIP ------------

The rest of the file is simple configuration. I thought by calling the
org.apache.struts2.dispatcher.**ng.filter.StrutsPrepareFilter right after
my AppFilter (which handles cert based authentification) I would already be
calling the Struts Dispatcher, but apparently thats where I'm wrong?

Thank you for your help to a newbie!

Best
Fabian




--
media transfer AG

Fabian Richter, M.Sc.
Softwareentwickler

Mail:    frich...@mtg.de
Telefon: +49 6151 8193-24
Telefax: +49 6151 8193-41
Web:     http://www.mtg.de

Firmensitz: Dolivostraße 11, 64293 Darmstadt
Registergericht: Amtsgericht Darmstadt, HRB 8901
Vorstand: Jürgen Ruf (Vors.), Tamer Kemeröz
Aufsichtsratsvorsitzender: Dr. Thomas Milde

Attachment: smime.p7s
Description: S/MIME Kryptografische Unterschrift

Reply via email to