Did you try to read the values without tag. By the way add this method to
unitVo of you java file and rerun the sample that I give you on your jsp. To
see that if actual values are set.

/**
 * Return all the fileds of this string
 */
public String toString()
{
    Class cl = getClass();

  String r = cl.getName() + "[";
  Class sc = cl.getSuperclass();

  if (!sc.equals(Object.class)) r += sc + ",";
  Field[] fields = cl.getDeclaredFields();

  //for all the fileds in this class
  for (int i = 0; i < fields.length; i++)
  {  Field f = fields[i];
     r += f.getName() + "=";
     try
     {  r += f.get(this);
     } catch (IllegalAccessException e)
     {  r += "???";
     }

     if (i < fields.length - 1)
        r += ",\n";
     else
        r += "]";
  }

  return r;
} 

-----Original Message-----
From: ashokd [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 29, 2002 4:38 AM
To: Struts Users Mailing List
Cc: [EMAIL PROTECTED]
Subject: Re: Pre Population Problem with FormBean - Urgent

Hi Fattahi,

I tried your sample java code in my jsp page. It is giving the following
output

I think the values are setting property in action class. but not displaying
form.

unitVO:
 com.vstl.wspr.WSPRUnitSelectionForm@70d90046

userId:
WUKD82

org.apache.struts.action.LOCALE:
en_US

unitselForm:
com.vstl.wspr.WSPRUnitSelectionForm@66498046

userType:
staff UserType:

C loginForm:
com.vstl.wspr.WSPRLoginForm@4a384046

Thanks & Regards,
Ashok.D


----- Original Message -----
From: "Alireza Fattahi" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Monday, February 03, 2003 4:02 PM
Subject: RE: Pre Population Problem with FormBean - Urgent


> Little guide line: try to minimize the scope of the error, hope use full.
>
> Try this could on you second page, to see what values are actually in
> session:
> <%
> Enumeration enmAttributeNames;
> String strAttributeName;
> Object objAttributeValue;
>
> request.getSession(true);
>
> enmAttributeNames = session.getAttributeNames();
> while (enmAttributeNames.hasMoreElements())
> {
>   out.println("<TR>");
>   strAttributeName = (String) enmAttributeNames.nextElement();
>   out.print("<TD><B>" + strAttributeName + ":</B></TD>" );
>   objAttributeValue =  session.getAttribute(strAttributeName);
>   out.println("<TD><PRE>" + objAttributeValue + "&nbsp;</PRE></TD>");
>   out.println("</TR>");
>
>
> }
> %>
>
> If the values are in session then it is tag problems, don't do any thing
> with action.
> Else the value is not actually in session so the tags ca not show them
(fix
> the action). Try to read the session without using struts tags.
>
> -----Original Message-----
> From: ashokd [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 28, 2002 9:23 PM
> To: Struts Users Mailing List
> Subject: Pre Population Problem with FormBean - Urgent
>
> Hi,
>
>  In my application in Action Class we are setting FormBean values for
next
> screen.
>
>  In this scenario first time the values are not pre populating in next
> screen.
>
> If we refreshed the page i.e: the action invoking once again then  the
> values are prepopulating.
>
>
>  Scope of the Next FormBean : Session
>
>  Code in Action class:
>
>      TestForm unitForm =
>  (TestForm)aRequest.getSession().getAttribute("unitselForm");
>      if(unitForm == null){
>       unitForm = new TestForm( );
>      }
>            unitForm.setUnit("2");
>             unitForm.setUserId("Ashok");
>
>
>
>  Thanks in Advance,
>  Ashok.D
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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

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

Reply via email to