• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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
 
I'm just a poor boy, I need no sympathy, because I'm easy come, easy go, little high, little low, little 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
    Bookmark Topic Watch Topic
  • New Topic