You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Jennings, Christofer J." <CJ...@Semprautilities.com> on 2002/07/09 17:19:53 UTC

DynaActionForm and JSTL (was RE: DynaActionForm Advantages)

Looking at the JSTL 1.0 specification, section 3.3, leads me to believe that
DynaActionForm "properties" can be accessed through the JSTL EL but with a
different syntax than a regular JavaBean property.

Example:
	Regular JavaBean (e.g., ActionForm) EL syntax:
		<c:out value="${form.aProperty}"/>
		<c:out value="${form.aProperty.aSubProperty}"/>
	Map (e.g., DynaActionForm) EL syntax:
		<c:out value='${form["aProperty"]}'/>
		<c:out value='${form["aProperty"].aSubProperty}'/>

If anyone has done this sort of thing I'd sure like to know how it works.
Especially how/if accessing "aSubProperty".

I'm stuck using a container that can't support JSTL and I'm also not using
Struts 1.1 yet either so I can't confirm any of this. 

<c:out value='${me["2cents"]}'/>,
boz

-----Original Message-----
From: eddiemcgreggor@netscape.net [mailto:eddiemcgreggor@netscape.net]
Sent: Monday, July 08, 2002 6:19 PM
To: struts-user@jakarta.apache.org
Subject: RE: DynaActionForm Advantages


But are DynaActionForm's compatible with JSTL?

A discussion on taglibs-user made me think not:
http://marc.theaimsgroup.com/?l=taglibs-user&m=102433015725228&w=2

Eddie

Re: DynaActionForm and JSTL (was RE: DynaActionForm Advantages)

Posted by Joe Germuska <Jo...@Germuska.com>.
This would only work if ${form} implemented the Map interface.

Making the DynaBean interface extend the Map interface seems like a 
lot of overkill considering the number of places people might want to 
use it that have nothing to do with the JSTL...

Maybe you could make a case for having DynaActionForm implement Map, 
with a bunch of unsupported operations and delegating to the values 
hash otherwise.  It's still kind of cluttered, but at least it's off 
in Struts serving a specific need, instead of in beanutils.

Joe


At 8:19 AM -0700 2002/07/09, Jennings, Christofer J. wrote:
>Looking at the JSTL 1.0 specification, section 3.3, leads me to believe that
>DynaActionForm "properties" can be accessed through the JSTL EL but with a
>different syntax than a regular JavaBean property.
>
>Example:
>	Regular JavaBean (e.g., ActionForm) EL syntax:
>		<c:out value="${form.aProperty}"/>
>		<c:out value="${form.aProperty.aSubProperty}"/>
>	Map (e.g., DynaActionForm) EL syntax:
>		<c:out value='${form["aProperty"]}'/>
>		<c:out value='${form["aProperty"].aSubProperty}'/>
>
>If anyone has done this sort of thing I'd sure like to know how it works.
>Especially how/if accessing "aSubProperty".
>
>I'm stuck using a container that can't support JSTL and I'm also not using
>Struts 1.1 yet either so I can't confirm any of this.
>
><c:out value='${me["2cents"]}'/>,
>boz
>
>-----Original Message-----
>From: eddiemcgreggor@netscape.net [mailto:eddiemcgreggor@netscape.net]
>Sent: Monday, July 08, 2002 6:19 PM
>To: struts-user@jakarta.apache.org
>Subject: RE: DynaActionForm Advantages
>
>
>But are DynaActionForm's compatible with JSTL?
>
>A discussion on taglibs-user made me think not:
>http://marc.theaimsgroup.com/?l=taglibs-user&m=102433015725228&w=2
>
>Eddie


-- 
--
* Joe Germuska    { joe@germuska.com }
"It's pitiful, sometimes, if they've got it bad. Their eyes get 
glazed, they go white, their hands tremble.... As I watch them I 
often feel that a dope peddler is a gentleman compared with the man 
who sells records."
	--Sam Goody, 1956
tune in posse radio: <http://www.live365.com/stations/289268>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>