Rejeev Divakaran
Rejeev Divakaran

Reputation: 4504

How to redirect to an arbitrary jsp from Struts action class?

I have scenario like login page where when the user access any privileged page, it should redirect to login page and after login it should get redirected back to the original page. I can pass the original page as query parameter. However how can redirect to the original page from the LoginAction class?

Upvotes: 1

Views: 1573

Answers (1)

JB Nizet
JB Nizet

Reputation: 692231

Either use response.sendRedirect() and return null from your action, or return an instance of ActionRedirect from your action.

Upvotes: 2

Related Questions