• Post Reply Bookmark Topic Watch Topic
  • New Topic

URL Redirection  RSS feed

 
Fred Victa
Ranch Hand
Posts: 206
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Java Web application that uses the Spring framework. I have some controller classes. If I'm on a certain webpage, how would I get the application to be redirected to another URL?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some googling gave me http://www.tutorialspoint.com/spring/spring_page_redirection_example.htm

I will cross post this question to the Spring forums for you.
 
Jayesh A Lalwani
Rancher
Posts: 2762
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean redirect to a webpage outside of your webapp or inside your webapp? Are you trying to do a client side redirect or a server side forward? SOrry have to ask because a lot of times, people are confused

If your controller returns "redirect:XXXX", Spring will return a redirect command back to the browser. The browser will then redirect the user to the URL. This is a client side redirect. Client side redirect can work for any URL, but a round trip the the client's browser is required

If your controller returns a "forward", Spring will forward the request to the controller/JSP specified in the forward. The response doesn;t go to the client. This is a server-side forward. A server side forward doesn't require a round trip to the client, but can only work within the webapp
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!