[Struts] RequestProcessor as ServletFilter

S

ShadowMan

Hi all,
I would implement a simple authentication and authorization system .
I'm using Struts and I found that extending RequestProcessor is a right way
to do that (in place of ServletFilter use) ..
I also use Tiles framework, so when User attribute is not found on session,
I would redirect to the login page.
This page is defined as tile composition, so I have a logical name that
references it....how can I make a sort of "sendRedirect" to this page,
inside processPreprocess method of MyRequestProcessor?

thanx
 
M

Muz

you should be using TilesRequestProcessor.

processPreprocess {

....

if (user==null)
{
// forward to a struts action that takes us to the login tiles layout
doForward('/logintile.do', request, response);
}

return false; // response already completed

}

struts-config:
<action path="/logintile"
type="org.apache.struts.actions.ForwardAction"
<forward name="success" path=".login.tiles.layout"/>
</action>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top