File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Transfer Control from one jsp page to another jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Transfer Control from one jsp page to another jsp page" Watch "Transfer Control from one jsp page to another jsp page" New topic
Author

Transfer Control from one jsp page to another jsp page

priya sunny
Greenhorn

Joined: May 25, 2011
Posts: 15
Hi,
i have the login page, when i click submit button i wanted it to go to another jsp page. how is that possible in spring?
do i have to add something in dispatcher servlet
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 587
    
    3

When you click submit, the control should go to the controller, where it finds the appropriate method based on the request type(i.e POST/GET) from there, you return a ModelAndView object
priya sunny
Greenhorn

Joined: May 25, 2011
Posts: 15
Hi,
Thank you very much
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

priya sunny wrote:Hi,
i have the login page, when i click submit button i wanted it to go to another jsp page. how is that possible in spring?
do i have to add something in dispatcher servlet


Are you using Spring Security? Spring Security does it automatically if they are trying to access a secured page and they got redirected to the login page, cause they weren't logged in. Then when they login it will redirect them back to the first page they were trying to access. Also in the configuration of your login-form, there is a success url attribute you can set to send it to a particular URL.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
priya sunny
Greenhorn

Joined: May 25, 2011
Posts: 15
Hi Mark
I am not using Spring security.. i am new to spring..
Learning with POCs.
Thankyou..
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

priya sunny wrote:Hi Mark
I am not using Spring security.. i am new to spring..
Learning with POCs.
Thankyou..


So then more towards what Prasad wrote. You have to write that code in your Controller.

For it happening automatically for what you want. Spring Security is a better solution.

Mark
priya sunny
Greenhorn

Joined: May 25, 2011
Posts: 15
Hi Mark,
Is it possible for you to give me an example program using Spring Security or a link where it exists?? i am interseted in learning..
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

priya sunny wrote:Hi Mark,
Is it possible for you to give me an example program using Spring Security or a link where it exists?? i am interseted in learning..


Sure

http://static.springsource.org/spring-security/site/docs/3.0.x/reference/springsecurity.html

Good Luck

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transfer Control from one jsp page to another jsp page