NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
swatik_2000
Joined: 21 Sep 2008 Posts: 1
|
Posted: Sun Sep 21, 2008 10:19 pm Post subject: <jsp:setProperty working only with the value parameter |
|
|
I am a tester by profession and completely new to web application development. However, there is a small project I am trying to develop for which I need to take user values in text fields on a form and save them to the database. I am using netbeans 6.0.1, the tomcat server that comes with that installation and Mysql for the database.
I have an index.jsp page, with a text field in it.
<INPUT type = "text" name=locNm value = "<%= locNameTextValue %>" size = 20 maxlength = 20>
and the form attributes:
<form action="insertLocationData.jsp" method=POST enctype="multipart/form-data">
<input type="submit" value="Create Location" name="CreateLocation" />
<input type="reset" value="Cancel" name="Cancel" />
</form>
My insertLocationData.jsp has useBean and setProperty to pass this field value to the database.
<jsp:useBean id="locationInsert" scope="request" class="loc.locationManager">
<jsp:setProperty name="locationInsert" property="locNm" />
</jsp:useBean>
My java class, has a constructor where locNm is set to "". I have corresponding getter and setter methods defined as getLocNm() and setLocNm(location_name).
However, setProperty does not execute the setter method from the bean. I tried debugging it, but, the setproperty line is simply skipped everytime, unless, I explicitly use the value parameter
<jsp:setProperty name="locationInsert" property="locNm" value ="a"/>
For all other usages of setProperty including,
<jsp:setProperty name="locationInsert" property="locNm" param = "locNm"> and
<jsp:setProperty name="locationInsert" property="*" />, the line is skipped and the value of my bean parameter is not set.
Can someone kindly help and let me know where is it that I am going wrong.
Thanks
Swati |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|