Hi lozano
I had the same problem. whenever i close the pop up window the session is lost in the parent window too. I am using JDeveloper as IDE and weblogic to deply. Someone adviced me that this is a problem with the OC4J contained shipped with JDeveloper. But I doubt this may also be due to some bug in IE.

Brati Sankar Ghosh
Tata Consultancy Services
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com



"grati_a_lozano" <[EMAIL PROTECTED]>

05/14/2004 04:14 PM

Please respond to
"Struts Users Mailing List" <[EMAIL PROTECTED]>

To
[EMAIL PROTECTED]
cc
Subject
Session attributes lost when open a popup window





Hi all,

I'm working with Struts 1.1.

When open a JSP page in a popup window with _javascript_, the Session
attributes are lost.

I make a little example:

The test1.jsp put one attribute ("test1") in Session and invoke
test2.jsp in two ways:

a) When submit the form, a forward is defined to return test2.jsp

b) Using a _javascript_ function

Test2.jsp only must check that the attribute "test1" exists and
display it:

That is TEST1.JSP

<SCRIPT language="_javascript_">
        function openwindow(){
                aBase='<html:rewrite
page="/test2.jsp" />';
                window.open(aBase, "test2",
"200", "200");
        }
</SCRIPT>

<TITLE>TEST1</TITLE>
<% request.getSession().setAttribute("test1", "hola"); %>
</HEAD>

<BODY>
        <html:form action=""
                <html:text property = "texto"/>
                <html:submit value="test2"/><br>
        </html:form>

        <a href=''>test2</a>

</BODY>

That is TEST2.JSP

        <BODY>
           <logic:present name="test1">
              session.test1:
             <bean:write name="test1" scope="session" /><br>
           </logic:present>
        </BODY>


That is the piece of struts-config.xml concerned (test1Action do
nothing but returns the addecuate forward ).

        <action-mappings>
             <action  
                  name="test1"
                  path="/test1Action"
                  scope="request"  
                  type="test_struts.forms.test1Action">
                  <forward
                    name="success"
                    path="/test2.jsp" />
             </action>
        </action-mappings>


And that is the result:

If test2.jsp is invoked via the Submit button, it is open in the same
browser window and display:

        session.test1: hola

If test2.jsp is invoked via the link, nothing is displayed.

I'm looking in Google and  it seems that the session ID (jsession) is
lost.

To avoid that I tried to change the _javascript_ code using the next:
     <% String url ="" %>
     window.open( <%=url%>,"TEST", "200", "200");

but with the same results.

My questions are:
How can I open a popup window without losing session?
Is there another way to do that using Struts tags?.

Thanks in advance and excuses for my English.

Regards.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


ForwardSourceID:NT00008F22    
DISCLAIMER: The information contained in this message is intended only and solely for 
the addressed individual or entity indicated in this message and for the exclusive use 
of the said addressed individual or entity indicated in this message (or responsible 
for delivery
of the message to such person) and may contain legally privileged and confidential 
information belonging to Tata Consultancy Services. It must not be printed, read, 
copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person 
other than the addressee. 
Unauthorized use, disclosure or copying is strictly prohibited and may constitute 
unlawful act and can possibly attract legal action, civil and/or criminal. The 
contents of this message need not necessarily reflect or endorse the views of Tata 
Consultancy Services on any subject matter.
Any action taken or omitted to be taken based on this message is entirely at your risk 
and neither the originator of this message nor Tata Consultancy Services takes any 
responsibility or liability towards the same. Opinions, conclusions and any other 
information contained in this message 
that do not relate to the official business of Tata Consultancy Services shall be 
understood as neither given nor endorsed by Tata Consultancy Services or any affiliate 
of Tata Consultancy Services. If you have received this message in error, you should 
destroy this message and may please notify the sender by e-mail. Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to