• 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

JSP forward tag

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Raymond O'Leary
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Of course, I found a very beautiful couch. Definitely. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic