Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

getRequestDespatcher() to open in another frame??

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Is there a way to open up a servlet/jsp/html in another frame using getRequestDespatcher()?? I have to open up a html page from a servlet (which is inside a frame) using getRequestDespatcher().
Please help out.
Regards,
Vijay
 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why dont you set the
target parameter to "new" in the calling HTML ?
That is simple.
 
Vijay Kashyap
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Deep Narsay,
But where should I set the target parameter ?
Regards,
Vijay
 
Mahesh Rana
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijay,
If you are calling this servlet via HREF then
<a href=myServlet target=new>Hi</a>
If you are calling thr' a form then syntax would be
<form action=myServlet
target="new"
method=post
>
....
...
<form>
Is that what you want ?
Regards.
 
Mahesh Rana
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want it in another frame (not a new window, )
set target to parent.frames['your another frame']
 
Vijay Kashyap
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deep Narsay,
It seems I am not able to explain the problem I am sorry for this.
I am using getRequestDespatcher() method to forward request to an html page (login page), but I want to open this html page in another frame (not in the same frame as the servlet).
My page is divided in 2 frames , upper part contains an applet which calls the servlet, if servlet is not able to retrieve the session for the user it forward the request to login.html but because its applet which is calling the servlet ( and I donot have source code for applet) I cannot pass the target parameter to servlet while calling it.
I need a method to open the login.html in 2nd frame.
Thanks for replying.
Regards,
Vijay
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!