This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes jsp onload redirection.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "jsp onload redirection.." Watch "jsp onload redirection.." New topic
Author

jsp onload redirection..

Cyrus Serrano
Ranch Hand

Joined: Sep 29, 2003
Posts: 137
Hi all,

is it possible for a JSP in BEA to redirect onto an Action before the page is loaded.. i have this condition before this jsp is loaded is the value of a certain session variable is say 'Y', then i will redirect this page. Otherwise i will load this jsp file..
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8713
    
    6

You can do such a thing in a scriptlet but it reeks of bad design. It is far better to keep your logic out of the presentation logic. Why don't you check that session variable in your Action and forward to the appropriate JSP?


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Cyrus Serrano
Ranch Hand

Joined: Sep 29, 2003
Posts: 137
hmm. i've thought about and implemented such for now, but i have 7 ACTION going on that jsp page. at the onload event of the jsp page i have to check for that session variable if its on such value i have to bypass the loading of that page and jump to action of that page.

So you imply i should code those condition on each ACTION??



Thank you Joe..
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8713
    
    6

You can forward to an action. Have your 7 actions forward to one action that then makes the determination as to which JSP to forward to.
Cyrus Serrano
Ranch Hand

Joined: Sep 29, 2003
Posts: 137
testing.. thanks Joe
[ February 14, 2007: Message edited by: Cyrus Serrano ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: jsp onload redirection..
 
Similar Threads
destroying downloaded files
error "Status 404" on redirect
Value shows up in url
forwarding to jsp
Displaying progress when loading JSP