• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Problem with Iframes

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to use Iframes in a JSP(say A.jsp) . The IFrame has its src attribute pointing to another JSP (say B.jsp) . Now the B.jsp requires the request object that A.jsp has . But if I am calling B.jsp in IFrames it does not seem to get the IFrames .
Any idea of what could be happening here ?
Any help would be appreciated . Very urgent.
Regards,
Puneet
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The I-frame acts like a different page, so it is like having two windows open. You could use javascript to load the iframe after page a has been loaded, but do you want to rely on javascript?
Eric
 
Sheriff
Posts: 67619
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
As Eric has pointed out, the parent window and the iframe are processing separate requests. The request instance of the parent cannot be shared with the iframe child.
If you want the two 'pages' to be part of the same request, perhaps a scrollable div in the parent (as opposed to an iframe) would suffice.
Otherwise, you'll need to find a way to share the data you want from the request instance since you cannot share the request instance itself.
hth,
bear
 
Puneet Agarwal
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the answers .
I have the requirement of using IFrames only . Any pointers of how exactly to use javascript to load the iframe after the parent window has loaded.
Thanks,
Puneet Agarwal.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you just need to change the location of the iframe onload iwht you parameters passed in the query string...
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic