respose.sendRedirect() to a specific frame

Hi,

I have a servlet called from one frame that will respond to a different frame. How can I do this?

Currently I have tried:

res.setHeader("Window-target","main");
res.sendRedirect(req.getScheme() + "://" + req.getServerName() + ":"+ req.getServerPort() + "url here");

Thanks,

Matt
LVL 1
MatthewLAsked:
Who is Participating?
 
Venci75Connect With a Mentor Commented:
In the html of the first frame use:
<a href="your servlet url" target="the name of the second frame">something ..</a>
0
 
MatthewLAuthor Commented:
Hi Venci75,

I need to do this from within the Servlet as this action will be the result of a submit from one of the child frames.

Matt
0
 
bagi112599Commented:
Then you can't do it.
Probably you should try to change your design logic,
while keeping your business logic about the same.
Why don't you give a brief description of what you are doing?
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
maggariCommented:
<a href="your servlet url" target="the name of the second frame" onClick="javascript:document.yourFormName.submit();">something ..</a>
0
 
maggariCommented:
don't put anything in the href..

say href=""
0
 
Venci75Commented:
or - you can declare you form as:
<form  target="the target frame name" action="your url" form attributes like "action" or "method" >
use standard submit button:
<input type=submit>
</form>

0
 
MatthewLAuthor Commented:
Hi Venci75,

I realised I had misinterpeted your answer.  Works perfect now!

Thanks,

Matt
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.