Chen, Gin wrote:
Hi all,
I was wondering if there was a way using JSTL to set a property on a
bean?
For example:
I have a page that shows the country.
If the country is null then I want to use USA as the default.
My code looks like:
<c:if test="${empty applForm.country}">
... i want to set it to USA but ...
... i dont know what to use here ...
... c:set only sets a scoped var but cant use the bean (if
i'm reading Shawn's book right)...
</c:if>
is this possible using jstl or struts? i looked at the struts doc
but dont see anything there either.
Use <c:set>:
<c:set target="${applForm}" property="country" value="USA" />
Hans
--
Hans Bergsten <[EMAIL PROTECTED]>
Gefion Software <http://www.gefionsoftware.com/>
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
Details at <http://TheJSPBook.com/>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>