aspose file tools*
The moose likes JSP and the fly likes JSP forward tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP forward tag" Watch "JSP forward tag" New topic
Author

JSP forward tag

Raymond O'Leary
Greenhorn

Joined: Mar 23, 2004
Posts: 24
Hi guys,
I'm using the jsp forward tag in a login page. The login page is in between two frames. But when the forward tag kicks in the target page loads up between the original two frames and I'm left with a 5 frame page!
In html you use the target is =_parent. Is there a jsp equivalent?
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Negative, buddy. Each frame in an HTML document is a separate request to a web server. You could always return some javascript in that middle JSP if you wanted, which would forward the whole thing as you wanted.
But, if you're looking for a strictly JSP approach, I'm afraid there's nothing you can do about it.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
forward is more of a jsp action than a tag.
I wanted to correct that.
By the way if your system involves frames, it needs more logic to take care of your problem( may be you can start using Struts-tiles to circumvent this problem).
Kishore.


Kishore
SCJP, blog
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Without a little more information, and perhaps some code fragments, it's difficult to tell what you are even trying to accomplish. For example:
The login page is in between two frames.

makes no sense to me. Do you mean between iframes? If not, then having something between frames in a frameset makes no sense.
So what are you trying to do in the first place?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Raymond O'Leary
Greenhorn

Joined: Mar 23, 2004
Posts: 24
This is what I mean
"between two frames"
<html>
<head><title>PMS</title></head>
<frameset cols="15%,70%,15%" border=0 noresize="true">
<frame src="lside.html" noresize="true">
<frame src="login1.jsp" noresize="true">
<frame src="rside.html" noresize="true">
</frameset>
</html>
And when the page loads up after the forward in login I have something like:
//this isnt the exact code by the way
<html>
<head><title>PMS</title></head>
<frameset cols="15%,70%,15%" border=0 noresize="true">
<frame src="lside.html" noresize="true">
<frame src="index.html" noresize="true">
<frame src="main.jsp" noresize="true">
<frame src="news.html" noresize="true">
<frame src="rside.html" noresize="true">
</frameset>
</html>
the frames index, main, and news replace the login.jsp page.
Raymond
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

So I assume that after the login is processed, that you are forwarding to a page with a completely new frameset?
If so, then you must either:
1) Use the target attribute on the form that submits the login info. Once a request is submitted, you cannot change the window/frame to which it is targetted. This approach creates problems, however, if you simply want to go back to the login page in the first frameset upon a failure.
So I would take approach
2) After a successful login, forward to a page that contains a Javascript snippet that cause the 2nd frameset to be loaded into the window named "top". For example:

or some such.
[ March 23, 2004: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

P.S. I'd advise looking into alternate mechanisms for partitioning your pages (iframes, scrollable divs, etc). Framesets are rather passe, and create all manner of headaches of which this is likely to be only your first.
This assumes that you are intelligently not supporting dinosaurs such as Netscape 4.
Raymond O'Leary
Greenhorn

Joined: Mar 23, 2004
Posts: 24
Ok thanks for that guys, to be honest the frames that are causing the trouble aren't really vital in the first place, just window dressings so I'll probably just get rid of them.
Thanks for your help.
Case closed
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP forward tag