Hi,
This has to be one of the most bewildering thing I have faced in my 3 months
of learning struts.
Now I have an action(PreapreAction) which I use to prepare a page for
display. This for fetches values from a Database and creates an instance of
the formbean and puts values into the form bean. Now i do
request.setAttribute("formBeanName",formBeanObject). And then forwards to
the page which has something like this
<html:form action="/fooAction">

......
</html:form>

the fooAction has formBeanName as its form bean defined in the struts
config. But Im not able to get any values into the fields in my form.

However if I do this
<bean:write name="formBeanName" property="someProperty" />. It prints the
correct value i.e. the value that I set in the PrepareAction. Does this mean
that there are two form bean in the request scope. but theere cant be two
attributes with the same name.

So i printed all the attribute names and their class in my jsp page.
Turns out there is another attribute of type formBeanObject in my request
under the key org.apache.struts.taglib.html.BEAN

Why is this happening?? I even tried using they key
org.apache.struts.taglib.html.BEAN in my PrepareAction but still ti does not
work.

SO i printed a message from the default constructor of my form bean. Thats
printed twice, once when i instantiate it in PrepareAction and again when
the page is loaded.

Plz plz help me sort this out.

--
Puneet

Reply via email to