back end of the "< jsp:setProperty" tag

Reply

Join Date: Sep 2006
Posts: 68
Reputation: rpjanaka is an unknown quantity at this point 
Solved Threads: 0
rpjanaka rpjanaka is offline Offline
Junior Poster in Training

back end of the "< jsp:setProperty" tag

 
0
  #1
Feb 6th, 2007
Hi

I am using the "< jsp:setProperty " tag....

so I want to set the properties manually if the corresponding property field is empty(null) in the web form.

So it was hard corded in the setter method of the bean class.

public void setName(String name) {
if (name == null) {
this.name = " ";
}
else {
this.name = name;
}
}


but this is also not working. That is when the given name field is empty, the created object still has null for its name field.

so I suggest that when some field is empty, this tag library does not call the corresponding setter method..


Please anyone can help me to do this, and please explain me how this tag is internally worked....

Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: back end of the "< jsp:setProperty" tag

 
0
  #2
Feb 8th, 2007
jsp:setProperty does not set the value in the bean, it rather sets a bean as a variable that can be accessed from scriptlet code on the JSP.

Completely deprecated with the introduction of JSTL and now JSF.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for JSP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC