Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use
<controller processorClass="org.apache.struts.action.SecureTilesRequestProcessor" />
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have SecurityProcessor extend TilesRequestProcessor rather than RequestProcessor. Then specify only SecurityProcessor in the struts-config.xml file.
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic