File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 8997
    
    9

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?


[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: 8997
    
    9

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp onload redirection..