aspose file tools*
The moose likes Other Application Frameworks and the fly likes Sitemesh doesnt decorate any pages after action class is called Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Sitemesh doesnt decorate any pages after action class is called" Watch "Sitemesh doesnt decorate any pages after action class is called" New topic
Author

Sitemesh doesnt decorate any pages after action class is called

David Brave
Greenhorn

Joined: May 20, 2010
Posts: 24
Hello, I have a problem with sitemesh.
I have 2 pages, Login.jsp and Success.jsp
Heres my decorator.xml file

If I use this pattern, then both my Login.jsp and Success.jsp are decorated.
If I switch the pattern to this

Then only Login.jsp is decorated (as expected).
But If I change the pattern to

Then my Success.jsp page doesnt get decorated.
Success.jsp is called after Login.jsp subits its data to my action class. The action class loads the Success.jsp page.
It loads it without being decorated. The only thing I can think of is if sitemesh isnt working with my action classes,
but I havent read about anyone having this issue.
here is my struts.xml file

Does anyone know why it would ignore the jsp pages that are called up from an action class?
Please help me if you have any ideas whatsoever.

sincerely,
thebravedave
David Brave
Greenhorn

Joined: May 20, 2010
Posts: 24
As an after note to my post above:

When my browser calls up Success.jsp (after authentication occurs), the browser shows the action in the url, not the Success.jsp page.

ie: http://localhost:8080/Authentication/login.action

vs: http://localhost:8080/Authentication/Success.jsp

So mabey sitemesh is not recognizing my actions page direction?

thebravedave
David Brave
Greenhorn

Joined: May 20, 2010
Posts: 24
Found my answer.

in my web.xml file, where you specify the filter mapping for sitemesh, you must declare when you want the dispatcher to use the sitemesh
framework. I didnt originally specify any <dispatcher>'s in my web.xml file, which meant that it was only picking up requests, not when
the action was setup to forward to a jsp page, like with my Success.jsp page.
i set my filter-mappings up as below to have sitemesh start working with my actions that forward.
hope this helps someone...thebravedave
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Sitemesh doesnt decorate any pages after action class is called