Opening a New Window and Tracking that session
I want to open a new IE popup window form my session -based application,the newly launched page is outside the current domain say a page in the internet.Does the session cookies are carried from the parent window to this newly opened window ?
If not how can i make it available in the child window?
Hi ,
I think you are using HttpServletResponse to redirect th page to another.If not you are just using anchor tag , right ?
what ever may be ...............
encodeURL(java.lang.String url) Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.This method returns String ...
if U r using <a href >tag , encodeURL java.lang.String url) is more enough ...
If U r using HttpServletResponce object , U need to go for furthur step.
use the following method.
sendRedirect(new encodeURL(java.lang.String location));
I HOPE THIS WOULD HELP YOU....
Cheers
Rajasekhar K
India
Raj!
I am sure that your response would be quite helpful.
Just to let you know that TYPING IN CAPITALS is like shouting in forum tradition. I am sure that you are not doing so, but for your information.
And finally please avoid sms slang, so that everyone can understand your point. (You might have observed in other threads, many gentlemen got irritated about it)
Hope you would not mind my suggestions.
Rk.
regards
Ramki
Message was edited by:
passion_for_java
Thanks for the reply Mr.Rajshekar,the idea is to open a window which is not at all in my domain, say for example i am launching the google page by supplying a query string.And the page is lauhcned with the search result .I want to read these contents and get them to my server.
I believe cross domain scripting is not allowed.I tried thisw am gettign Access denied exception.I believe icould achieve this using Activex plugin.But i dont want to go for it , as it tis again a security headache for me.
If you can throw someother idea, it would be of great help
Thanks
Vishy
moreover how can i supply my session id to launch the google page .. .it wotn give me a proper result correct?
hi, rk
thanks for your suggestions, iam new to forums.
thanks a lot
thank you
Raj
hi
if you are using jsp , even you can try with JSTL (<c:import>,<c:redirect>)
<c:import url="/content.html" var="newstuff" scope="session">
<c:param name="par1" value="val1"/> // optional
<c:param name="par2" value="val2"/>// optional
</c:import>
<c:import>, which accesses content outside
the web application, and
<c:redirect>, which tells the client browser to access a different URL
thanks
Raj
Anything like this is going to provoke security reactions, since it's the kind of thing that lends itself to malicious use.
You could consider using frames, where you wrap the other-domain window in your own, but it's likely to provoke security warnings.
An approach which is more challenging, but likely to produce cleaner results, is for your server, itself, to make URL connections to the other domain and retrieve the data, then process and probably reformat it, including it in your own page.
The down side is you can be tripped up by changes in the third-party site's layout etc.
If you check with the other domain, you may find that it can deliver results in a more program-friendly format, such as XML.