• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSTL redirect tag

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to redirect the users to a different page from a JSP page and use syntax below. It does not redirect (URL reamains same)and seems does not disply anything either. URL remains current. How do we do this?

<c:redirect url="dest.jsp">
</c:redirect>

I guess I should not be using <jsp:forward> as that will keep the URL same event though internally page may be redirected?

Thanks
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My guess is that you are creating an IllegalStateException when you try and redirect. Check your logs for any errors.

SendRedirect requires the server to cancel any output already built up to date, and send a completely different one. If the response has been "flushed" or "committed" it can't do that, as it has already passed the point of no return.

Possible Solutions:
1 - put your c:redirect tag as early as you can on the page. That way there is less chance the buffer will fill up and create an error

2 - Make your buffer larger: <%@ page buffer="32kb" %> and see what happens.

Cheers,
evnafets
 
Raj Puri
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess sendredirect is not the way to go. I want to do this:
Initialize some params and then redirect the page to a different location with param. The users should see that in URL fo changed location. I do that in Javascript but since my page is Meta Data driven so I can not use Jscript, hwo else can I do this?
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic