wood burning stoves 2.0*
The moose likes Servlets and the fly likes Filter-mapping in web.xml error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Filter-mapping in web.xml error" Watch "Filter-mapping in web.xml error" New topic
Author

Filter-mapping in web.xml error

David Brave
Greenhorn

Joined: May 20, 2010
Posts: 24
Hello, Im having an issue with my web.xml's filter-mapping configuration.
Im using sitemesh with struts2.
My initial jsp page is called, people submit their login info, the info is sent to an action class which forwards
to my Success.jsp page.

My problem lies within my web.xml's filter-mapping.
In my filter-mapping for sitemesh, under <dispatcher> i have Request and Forward. If I use both then
my Requests get decorated, but not my Forwards.
If I designate Forward, but not Request, then my requests show up, but not after an action class is executed and a Forward takes place.
ie:

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

VS

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

I would like to use both FORWARD and REQUEST and have my requests AND forwards show up.
Everything I read online points toward this being the default if you specify both forward and request in <dispatcher>,
but mine seems to do only one or the other.

Any ideas?

Sincerely,

thebravedave


Rendi Artha
Greenhorn

Joined: Jan 20, 2010
Posts: 29
well the only things is, this is not servlet case. but how to decorating your correct template into your pages.
You can defines what mappers SiteMesh is going to apply while finding decorators for a particular page by editing WEB-INF/sitemesh.xml.
Mostly i attach "com.opensymphony.module.sitemesh.mapper.PageDecoratorMapper" into decorator-mapper so that i can see each template applied into my page by switching it using decorator&confirm parameter. Such as like this :

http://localhost:8080/MyDemo/login.htm?decorator=headerfooter&confirm=true
http://localhost:8080/MyDemo/login.htm?decorator=mainMenu&confirm=true


My web.xml using FORWARD only since I use frontController such as SpringMVC or Struts/Webwork action.

Rgds,

 
Don't get me started about those stupid light bulbs.
 
subject: Filter-mapping in web.xml error
 
Similar Threads
moved from jboss-4.0.3 to jboss-5.1.0 where do I put my war files
Sitemesh doesnt decorate any pages after action class is called
[struts2] [sitemesh] [i8N] its not decorate anymore
How do servlet mapping in web.xml that the path information is not lost
Struts2 Action/OGNL in SiteMesh decorator