Eduardo Catarino wrote:
Hi Marcel,

        After looking again I tried the following change in the getParameter 
method of AppletServlet.java:

   public static final String getParameter(HttpServletRequest req, String name, 
String defaultVal) {
      if (name == null) {
         return defaultVal;
      }
//////////Old line////////////////////////////////////////
        // Object obj = req.getParameter(name);
        /////////////////////////////////////////////////

        ////New line
        Object obj = req.getSession(false).getAttribute(name);

      if (obj != null) {
         return (String)obj;
      }
      return defaultVal;
   }

In this way I can in runtime add an attribute to the session object

        session.setAttribute("xmlBlaster/invalidate","false");

and solve the problem in a clear way. Is there any other way to do it?
I think you can set this already in
xmlBlaster/demo/http/WEB-INF/web.xml:

<servlet>
<servlet-name>AppletServlet</servlet-name>
<description>Persistent HTTP connection demo servlet</description>
<servlet-class>org.xmlBlaster.protocol.http.appletproxy.AppletServlet</servlet-class>
 <init-param>
   <param-name>xmlBlaster/invalidate </param-name>
   <param-value>false</param-value>
 </init-param>
 ...


If not will, the code, be changed in a future version?
If you send a patch with xmlBlaster extensions we usually add it (if it makes sense :-)
but in this case i don't think its necessary?

regards
Marcel
Best regards,
Eduardo




Hi Marcel,


        After looking into the code of XmlBlasterAccessRaw.java I tried to add 
the following line to the applet parameters:

     <param name="xmlBlaster/invalidate"                          VALUE="false" 
/>

But the problem remains. Any tips?

Best regards,
Eduardo

-----Original Message-----
From: Eduardo Catarino Sent: quarta-feira, 21 de Dezembro de 2005 14:46
To: '[email protected]'
Subject: RE: [xmlblaster] session object erased????

I Marcel,

        I take a look into the AppletServlet.java and added the following lines 
just to see what was happening:

         boolean invalidate = getParameter(req, "xmlBlaster/invalidate", false);

         log.info(ME,"GET PARAMETER -> " + 
req.getParameter("xmlBlaster/invalidate"));
         log.info(ME,"GET URI -> " + req.getRequestURI());
         log.info(ME,"GET PARAMETER -> " + 
(String)req.getParameter("xmlBlaster/invalidate"));
         log.info(ME,"GET RESULT INV -> " + invalidate);
         if (invalidate == true) {

            log.info(ME, "Entering servlet         
doGet("+I_XmlBlasterAccessRaw.CONNECT_NAME+"), forcing a new sessionId");
            session.invalidate();   // force a new sessionId
         }
         session = req.getSession(true);
      }


And the feedback was:

[21/Dez/2005 14:35:22 INFO  http-8080-Processor24 
org.xmlBlaster.protocol.http.appletproxy.AppletServlet-127.0.0.1-#1req3-dummyToCreateASessionId]
 GET PARAMETER -> null
[21/Dez/2005 14:35:22 INFO  http-8080-Processor24 
org.xmlBlaster.protocol.http.appletproxy.AppletServlet-127.0.0.1-#1req3-dummyToCreateASessionId]
 GET URI -> /Liaison/XMLBlaster/AppletServlet
[21/Dez/2005 14:35:22 INFO  http-8080-Processor24 
org.xmlBlaster.protocol.http.appletproxy.AppletServlet-127.0.0.1-#1req3-dummyToCreateASessionId]
 GET PARAMETER -> null
[21/Dez/2005 14:35:22 INFO  http-8080-Processor24 
org.xmlBlaster.protocol.http.appletproxy.AppletServlet-127.0.0.1-#1req3-dummyToCreateASessionId]
 GET RESULT INV -> false


The page that where I use the xmlblaster applet is called like this:

        <frame name="alerts" 
src="../XMLBlaster/operationalAlertScreen.jsp?ActionType=login&xmlBlaster/loginName=operationalAlert&xmlBlaster.passwd=operationalAlert&xmlBlaster/invalidate=false"
 scrolling="no" target="_self">


Additionally I checked in the beginning of the page the contents of the 
xmlBlaster/invalidate and saw that was false.

So I'm thinking that I'm passing this parameter in the wrong way. But how can I 
initialize the AppletServelet in a proper way?

Best regards,
Eduardo



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marcel Ruff
Sent: terça-feira, 20 de Dezembro de 2005 17:28
To: [email protected]
Subject: Re: [xmlblaster] session object erased????

Eduardo Catarino wrote:
Hi Marcel,

I changed the '.' to '/' but the results are the same. The data previously saved is erased.
Hi again,

please us a debugger and debug into

xmlBlaster/src/java/org/xmlBlaster/protocol/http/appletproxy/AppletServlet.java

the important parts to watch are

  req.getSession(true);
  ...
  session.invalidate();   // force a new sessionId

this code forces under some circumstances a new session,
you should see immediately what is going on,

regards
Marcel
I launch the applets page like this:


----------------------Start-------------------------------
<%
        session.putValue("xmlBlaster/invalidate", "false");
        session.putValue("xmlBlaster/loginName", "eduardo");
        session.putValue("xmlBlaster/passwd", "secret");
%>
<html>

<head>
<title>LIAISON</title>
<base target="_self">
</head>

<frameset framespacing="0" border="0" frameborder="0" rows="119,*">
                <frame name="main" src="second_top.jsp" scrolling="no" 
target="indice" noresize>
<frameset cols="460,*" framespacing="2" border="1" frameborder="1"> <frameset rows="33%,33%,34%">
        <frame name="alerts" src="../XMLBlaster/operationalAlertScreen.jsp" scrolling="no" 
target="_self">
        <frame name="alert" src="../XMLBlaster/systemAlertScreen.jsp " scrolling="no" 
target="_self">
        <frame name="freeText" src="../XMLBlaster/freeTextScreen.jsp " scrolling="no" 
target="_self">
      </frameset>
          <frame name="main" src="" scrolling="no" target="_self">
</frameset>

<noframes>
  <body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">

  <p>Esta página utiliza frames, mas o seu browser não as suporta.</p>

  </body>
  </noframes>
</frameset>

</html>

        Am I doing something wrong? After the servelet is initialized the 
others variables, for example I have a variable that stores the application 
language, are changed to null.

Thanks in advanced,
And best regards to all,
Eduardo 



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Marcel Ruff
Sent: segunda-feira, 19 de Dezembro de 2005 16:09
To: [email protected]
Subject: Re: [xmlblaster] session object erased????

Eduardo Catarino wrote:
Hi Marcel and to all XmlBlaster Team,

Thanks again for answering me so quickly. However I think I didn't put
well my question. The problem is that when starting the applet a new object session (Browser) is created and all the data application is lost. I think is the xmlblater servelet that changes the session object. I read in the requirements that the xmlbaster servelet should be called before any other servelet to prevent this kind of problems.

My question is, what should I do in order to xmlblaster applet do not change the session object when it is initialized?

We use in AppletServlet.java this code:

boolean invalidate = getParameter(req, "xmlBlaster/invalidate", false);

Try to replace the '.' with a '/', this should help,

regards
Marcel
Best regards to all,

Eduardo Catarino


------------------------------------------------------------------------
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Eduardo
Catarino
*Sent:* sexta-feira, 16 de Dezembro de 2005 13:43
*To:* [email protected]
*Subject:* [xmlblaster] session object erased????

Hello to all,

I've developed an applet using the xmlblaster lib for applets I'm now facing a problem. When the applet is integrated in the real environment that uses the session object to store application data the
applet seems to create a new session object and erases all the data that was previously stored. I have been searching in the requirements and tried to use the following code:

session.putValue("xmlBlaster.invalidate", "false");

session.putValue("xmlBlaster.loginName", "eduardo");

session.putValue("xmlBlaster.passwd", "secret");

in order to prevent this from happening. However this didn't solve the
problem.

Can someone give me a tip how to solve this?

Merry Christmas and a Happy new year for all the xmlblaster team.







Reply via email to