• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

redirect to someother page for an request made using ajax.

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
i am facing problem while redirecting for an request made using ajax. this is how i am redirecting

return new ModelAndView("redirect:../users/userLogin.html");

it works fine for normal http requests.

basically when exception is thrown in our application we are redirecting the user to login page. For ajax requests if exception is thrown above line is not redirecting to the login page.

regards,
pavn kumar.
 
Ranch Hand
Posts: 49
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here redirection works fine but you could not see the login page as this is a ajax call the page will not be refreshed. for this you need to handle it differently like sending a error response status code and handle it in client side .if you get error status code you forward the page to login using location.href
reply
    Bookmark Topic Watch Topic
  • New Topic