File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Smoother redirect

 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, this is a "for dummies" question. I'm doing redirect with

<meta http-equiv="REFRESH" content="0;url=/yadda/yadda">

and it works fine, but it's a little unattractive. The original url shows for a fraction of a second and the page refresh is pretty obvious. Is there any smoother way?

I'm doing a Post-Redirect-Get pattern, thinking about doing the Post via AJAX and the redirect via script to just refresh the current URL.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64200
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using JSP/Servlets? I've noticed that initiating the redirect on the server is "smoother" than on the client. Which makes sense I guess. When initiated from the server, the browser recieves a response with no page to be evaluated. Using a page that contains markup and meta tags that require evaluation may be what's causing your blip.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, I've always done post-redirect-get by sending a redirect page to the browser. Wonder why it never occurred to me to do it at the server. Will give it a try!
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Man, the hoops I hadda jump through to make our front controller do a redirect. It's a major perversion of science, turned a developer hook for streaming output into doing the redirect. Worked great, tho. Thanks again!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64200
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Stan James:
Man, the hoops I hadda jump through to make our front controller do a redirect.
I assume that's a piece of technology you're locked into?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, originally written by the boss so it's pretty firmly in place.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64200
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Stan James:
Yes, originally written by the boss so it's pretty firmly in place.
My condolences.

<mini-rant>How can a front controller that doesn't allow redirects dare call itself a front controller?</mini-rant>
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic