struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Billy Ng" <evebi...@hotmail.com>
Subject Re: How to put value from <bean:message> to <html:img> tag
Date Sun, 15 Sep 2002 02:27:22 GMT
I also notice the the html:img tag will not allow me to do with the
following syntax.

parent.jsp
=======
<jsp:inlcude page "include.jsp">
  <jsp:param name="test" value="helloword" />
</jsp:include>

include.jsp
=======
<html:img src="..." name="<%= request.getParameter("test") %> ..... />

I need to like this which is urgly.

include.jsp
=======
<% String imgName = request.getParameter("test"); %>
<html:img src="..." name="<%= imgName %> ..... />


Billy Ng

----- Original Message -----
From: "Martin Cooper" <martin.cooper@tumbleweed.com>
To: "'Struts Users Mailing List'" <struts-user@jakarta.apache.org>
Sent: Saturday, September 14, 2002 6:47 PM
Subject: RE: How to put value from <bean:message> to <html:img> tag


> Unfortunately, you're right, with straight JSP you'd have to use a runtime
> expression. For some reason, this syntax is not allowed:
>
>   <jsp:param name="foo">
>     This is the value of the parameter.
>   </jsp:param>
>
> Even in the JSP 2.0 spec, it's not allowed.
>
> However, in JSTL, the <c:param> tag allows you to do this:
>
>   <c:import url="someurl">
>     <c:param name="foo">
>       This is the value of the parameter.
>     </c:param>
>   </c:import>
>
> Note that the <c:param> tag can only be used inside <c:import>, <c:url>
and
> <c:redirect> tags, and not in plain JSP tags.
>
> --
> Martin Cooper
>
>
> > -----Original Message-----
> > From: Eddie Bush [mailto:ekbush@swbell.net]
> > Sent: Saturday, September 14, 2002 3:57 PM
> > To: Struts Users Mailing List
> > Subject: Re: How to put value from <bean:message> to <html:img> tag
> >
> >
> > I think you'd have to use a run-time expression:
> >
> > <%= myVar %>
> >
> > I hate using them though.  Hopefully someone else will have a better
> > alternative for you.  Oh - just hit me that the JSTL has a
> > param tag too
> > --- and you could use the EL to specify your value, rather
> > than having
> > (something much too close to) a scriplet (for my taste) in
> > your page.  I
> > haven't used it, but my "best guess" is that it would be a drop-in
> > replacement for the <jsp:param> tag.
> >
> > Regards,
> >
> > Eddie
> >
> > Billy Ng wrote:
> >
> > >Sorry, I overlooked it.  That is what I'm looking for,
> > thanks!  Can I ask
> > >you one more question, what about if I want to pass the
> > value from the
> > >properties file to the jsp:param tag?
> > >
> > ><jsp:param name="alt" value="..." />
> > >
> > >Thanks!
> > >
> > >Billy Ng
> > >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>

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


Mime
View raw message