*
The moose likes Struts and the fly likes processorClass: tiles and security - how to have them both??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "processorClass: tiles and security - how to have them both???" Watch "processorClass: tiles and security - how to have them both???" New topic
Author

processorClass: tiles and security - how to have them both???

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
So...I have a securityProcessor that checks for the url when the request arrives. I also have the tiles org.apache.struts.tiles.TilesRequestProcessor.

Basically, my struts-config.xml looks like this:


as you can conclude, the SecurityProcessor is neglected because the following processorClass comes 2nd (and wins the priority).

Question: how can I enjoy both worlds by having the tiles and keeping my security?

Thanks
Steve Levin
Greenhorn

Joined: Jul 23, 2004
Posts: 11
Use
<controller processorClass="org.apache.struts.action.SecureTilesRequestProcessor" />
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
I don't think I fully understand you: how will my class, that extends RequestProcessor and override processPreprocess, will work?
and how will my struts-config.xml should be look like (with resoect to the controller processorClass)

thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Have SecurityProcessor extend TilesRequestProcessor rather than RequestProcessor. Then specify only SecurityProcessor in the struts-config.xml file.


Merrill
Consultant, Sima Solutions
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
thanks!!! it's working.

quick q: what is this line for?

<message-resources parameter="MessageResources"/>

it comes right after the

<controller processorClass="org.apache.struts.action.SecureTilesRequestProcessor"/>
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
It identifies MessageResources as the name of your resource bundle, meaning that it's telling Struts to look for a MessageResources.properties file in the WEB-INF/classes directory. Struts will then look for any message keys in this file for tags such as <bean:message> and also for error messages.
 
Consider Paul's rocket mass heater.
 
subject: processorClass: tiles and security - how to have them both???