wood burning stoves 2.0*
The moose likes Servlets and the fly likes getRequestDespatcher() to open in another frame?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "getRequestDespatcher() to open in another frame??" Watch "getRequestDespatcher() to open in another frame??" New topic
Author

getRequestDespatcher() to open in another frame??

Vijay Kashyap
Ranch Hand

Joined: Jul 30, 2001
Posts: 74
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
Mahesh Rana
Ranch Hand

Joined: Sep 05, 2001
Posts: 139
Why dont you set the
target parameter to "new" in the calling HTML ?
That is simple.

SCJP2
Vijay Kashyap
Ranch Hand

Joined: Jul 30, 2001
Posts: 74
Hi Deep Narsay,
But where should I set the target parameter ?
Regards,
Vijay
Mahesh Rana
Ranch Hand

Joined: Sep 05, 2001
Posts: 139
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

Joined: Sep 05, 2001
Posts: 139
If you want it in another frame (not a new window, )
set target to parent.frames['your another frame']
Vijay Kashyap
Ranch Hand

Joined: Jul 30, 2001
Posts: 74
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: getRequestDespatcher() to open in another frame??
 
Similar Threads
newbie question: how to have htm page call servlet, but not leave page?
let me know
How to throw open a html from a servlet which is called by another servlet ?
Framed window...please help ..urgent
Calling YUI function from another HTML page