You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian Boyle <b_...@hotmail.com> on 2004/03/07 18:17:32 UTC

Problem with Map-backed ActionForm and Key value

Hey, I am using a map-backed ActionForm and so in my JSP code I have a 
<html:text> tag that looks like this:
<html:text property="value(<%=value.getUserId()%>)" readonly="true" size="2" 
/>

The reason I have a scriplet in there is because I have a dynamic form and 
the value of the key changes all the time. I want the value of the key to be 
the "id" of the user logged in.

However, this is giving me problems because the value of the key is being 
taken literally as <%=value.getUserId()%> rather than the value of the 
userId. The scriplet <%= value.getUserId %> is correct because I have tested 
it with System.out.println(value.getUserId). So it looks like I cannot put 
my scriplet in there. Has anyone experienced this before? Or does anyone 
know why it won't et me do this? Any way to get around this?

I'd appreciate any help. I've been stuck on it for two days now.

Cheers,

B

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Problem with Map-backed ActionForm and Key value

Posted by Geeta Ramani <ge...@cmpco.com>.
Hey Brian:

Have you tried evaluating the keyValue ahead of time? As in:

<%String myKey = ..blah-blah.. using userId;%>
and then:
<html:text property="<%=myKey%>" readonly="true" size="2" />

Give it a shot if you haven't..
Good luck!
Geeta

Brian Boyle wrote:

> Hey, I am using a map-backed ActionForm and so in my JSP code I have a
> <html:text> tag that looks like this:
> <html:text property="value(<%=value.getUserId()%>)" readonly="true" size="2"
> />
>
> The reason I have a scriplet in there is because I have a dynamic form and
> the value of the key changes all the time. I want the value of the key to be
> the "id" of the user logged in.
>
> However, this is giving me problems because the value of the key is being
> taken literally as <%=value.getUserId()%> rather than the value of the
> userId. The scriplet <%= value.getUserId %> is correct because I have tested
> it with System.out.println(value.getUserId). So it looks like I cannot put
> my scriplet in there. Has anyone experienced this before? Or does anyone
> know why it won't et me do this? Any way to get around this?
>
> I'd appreciate any help. I've been stuck on it for two days now.
>
> Cheers,
>
> B
>
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org