• 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

Servlet redirect & frames

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a servlet which does all calculation and forward the results to a frame set (out.jsp) to display. The upper frame (top.jsp) will display the results as a list of hyperlinks, when a link is clicked, the output will then be displayed in the bottom frame (bottom.jsp). But when I tried to render the results in top.jsp, I cannot access the results passed from the servlet.
out.jsp:
<frameset rows="174,*">
<frame name="top" target="main" src="top.jsp">
<frame name="main" src="bottom.jsp">
</frameset>

For example, the servlet passes an object (for example A) by setAttribute, how can I get the object A from top.jsp? or other better way to handle this kind of problem?
Thanks for help!!!
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Number one I always say: forget frames. Don't use them. Throw them away.
I'm not really a fan.
If you want to have a frame to send a request then have the response change both frames, you have a couple of options...
The Javascript solution is to send the 'event' to the other frame too, so that it also sends a request to the server and both pages get updated in separate responses.
The other option is to send the request to the target '_top'. This initial request would return something like

then the two pages in the frames would both be reloaded and would both be passed the same data.
The better solution is to handle it server side and include multiple pages by .including the separate parts. That way they all refresh together and all get passed the same parameters and attributes.
Dave
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic