Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transfer Control from one jsp page to another jsp page

 
priya sunny
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 670
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thank you very much
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
priya sunny
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark
I am not using Spring security.. i am new to spring..
Learning with POCs.
Thankyou..
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic