You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ra...@lazard.com on 2003/03/07 21:48:02 UTC

problem with session

Hi,

 I am forwarding to an action servlet from a different one.

updatedel(actionForm,action);
        MffsActionForm mfform = (MffsActionForm)httpServletRequest.getSession
().getAttribute("mffsActionForm");
        httpServletRequest.getSession().removeAttribute("mffsActionForm");
        httpServletRequest.getSession().setAttribute("mffsActionForm",mfform);
        String tablename = ((MffsActionForm)httpServletRequest.getSession
().getAttribute("mffsActionForm")).getTables();
        LamLog.log(this,LamLog.INFO,"The tablename is " + tablename);

        httpServletRequest.setAttribute("mffsactionflag","true");
        return actionMapping.findForward("success");


I am able to see the value of "tablename" here  as "am_fs_allocation"

 in the forwarded servlet I do the following


String flag = (String)httpServletRequest.getAttribute("mffsactionflag");
      LamLog.log(this, LamLog.INFO, "Value of flag is " + flag);
if (flag != null && flag.length() > 0)
      {
        LamLog.log(this, LamLog.FATAL, "getting mffsActionForm from session");
        mfform
= (MffsActionForm)httpServletRequest.getSession(false).getAttribute(
            "mffsActionForm");
      }
      else
      {
        mfform = (MffsActionForm)actionForm;
      }
      LamLog.log(this, LamLog.FATAL, "got mfform");
      String tablename = new String();
      tablename = mfform.getTables();
      LamLog.log(this, LamLog.INFO, "Table name is " + tablename);


the flag is set correctly and I get the formbean(MffsActionForm) from the
session. But the value for the "tablename" is null.


What am I doing wrong??

Is there anyother way for the second servlet to get its formbean even if it is
forwarded from someother servlet.

Regards
Rajesh J





---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org