File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Problem with bean:write tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with bean:write tag" Watch "Problem with bean:write tag" New topic

Problem with bean:write tag

Nikhil Bansal
Ranch Hand

Joined: Jan 24, 2005
Posts: 60
Hi All,

I'm new to Struts.

I am writing a simple application wherein I am fetching data from database based on a parameter and displaying it to JSP.

For the display purpose I am <bean:write> tag but it is not working.

The code is as follows :

<tr><td><bean:write name="ContractForm" property = "contractNumber" scope="session"></td></tr>

where ContractForm is my form bean.I have given it's definition in struts-config.xml

The property contractNumber is defined as get and set methods in the Form bean.

However when I use the JSP expression <%=contractForm.getContractNumber()%> it works fine.

What am I missing.

Please help


Nikhil Bansal

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I suspect this may be a simple spelling error. Make sure the Action-form definition in your struts-config.xml file exactly matches the name attribute of your <bean:write> tag. Struts is case-sensitive.

Consultant, Sima Solutions
I agree. Here's the link:
subject: Problem with bean:write tag
It's not a secret anymore!