How to set a bean property to empty string using jsp/jstl?

I have a jsp that uses <jsp:setProperty name="beanname" property="*"/> to map submitted form values to a bean.  This is great unless a user wants to blank out a value (say, they put an address part in the wrong field and go back to correct.)  According to the documentation, jsp:setPropoerty will ignore any empty strings passed to it and leave the existing bean value.

So, I tried using JSTL tags like so:

<c:forEach var="parm" items="${param}">
  <c:set target="beanname" property="${}" value="${parm.value}"/>

However, this behaves exactly the same: values that have input in the form are set, but those that are empty retain their former values.  

Anyone know how I can set the values to empty strings once they've been set?  

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Your idea is good. It just needs two adjustments.  
1) put ${} around beanname
2) use parm.key instead of using
<c:forEach var="parm" items="${param}">
                 <c:set target="${beanname}" property="${parm.key}" value="${parm.value}"/>
mousseheadAuthor Commented:
Sorry, that didn't work.  Seems like c:set just passes through to the jsp:setProperty method.  Any other ideas?
It works for my test case. Please  try the following.
<%@ taglib uri="" prefix="c" %>
<jsp:useBean id="testBean" class="rrz.TestBean" scope="session"/>
<c:forEach var="entry" items="${param}">
                 <c:set target="${testBean}" property="${entry.key}" value="${entry.value}"/>
                  <input type="text" name="one"/>
                  <input type="text" name="two"/>
                  <input type="submit"/>
one = ${}<br/>
two = ${testBean.two}
package rrz;
public   class TestBean{
   private String one = null;
   private String two = null;
   public void setOne(String one){ = one;}
   public void setTwo(String two){this.two = two;}
   public String getOne(){ return one;}
   public String getTwo(){ return two;}

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mousseheadAuthor Commented:
That did the trick, just not in JSTL 1.0, which I'm stuck with for the moment.  Thanks for your help!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.