Sure, I prefer to use JSTL rather than Struts taglib, but <jsp:useBean>
should be replaced too by JSTL or Struts tags.

<bean:define id="map3" name="actionForm" property="map" />
<c:set target="${map3}" property="id" value="123" />
<c:set target="${map3}" property="name" value="ahmed" />

using this way is best case for me, I have added a Map to the action form to
get it works.

Thanks Mark for your help.


On 3/26/06, Mark Lowe <[EMAIL PROTECTED]> wrote:
>
> On 3/26/06, Ahmed Hashim <[EMAIL PROTECTED]> wrote:
> > Thanks Mark,
> > I tried it and it is working fine with Valid XHTML output, It is the
> best
> > solution I have till now.
> > But I hope that I can make it using Struts Tags if anyone know.
>
> I dont think there is, the handy thing with jstl is the way that map
> keys evaulate like bean properties.. ${user.id} could be a
> map.get("id") or a bean.getId(), jstl works it out.
>
> If you want my opinion, you're better using jstl whenever you can and
> avoiding all but the html taglib and tiles. The docs for bean tags
> start with the following notice
>
> "Note: Some of the features in this taglib are also available in the
> JavaServer Pages Standard Tag Library (JSTL). The Struts team
> encourages the use of the standard tags over the Struts specific tags
> when possible. "
>
> Mark
>
> >
> > Thanks.
> >
> >
> > On 3/26/06, Mark Lowe <[EMAIL PROTECTED]> wrote:
> > >
> > > On 3/26/06, Ahmed Hashim <[EMAIL PROTECTED]> wrote:
> > > > Dear All,
> > > >
> > > > <%
> > > >     java.util.HashMap rawSourceMap=new java.util.HashMap();
> > > >     rawSourceMap.put("id", "123");
> > > >     rawSourceMap.put("name", "ahmed");
> > > >     pageContext.setAttribute("ourrefLink",rawSourceMap);
> > > > %>
> > > >
> > > > <html:link action="Action" name="ourrefLink">
> > > > <bean:message bundle="job" key="job.joblist.button1" />
> > > > </html:link>
> > > >
> > > > I want to replace the scriptlet with a <bean:define /> tag but I
> don't
> > > know
> > > > how will i add the values to the hash map.
> > > > I want to avoid using scriptlet.]
> > >
> > > To be honest I haven't used the bean tag lib for years.. So i dont
> > > know how to do what you need with bean define. But you could do this
> > > in the refering action, I think the following jstl could also work (if
> > > you try let me know if it does or not).
> > >
> > > <jsp:useBean id="rawSourceMap" class="java.util.HashMap" />
> > > <c:set target="${rawSourceMap}" property="id" value="123" />
> > > <c:set target="${rawSourceMap}" property="name" value="ahmed" />
> > >
> > > Mark
> > >
> > > >
> > > > Thanks for your help.
> > > >
> > > >
> > > > --
> > > > In Life, it doesn't matter who you are, but whether someone
> appreciates
> > > you
> > > > for what you are, accepts you and loves you unconditionally. A Real
> > > Friend (
> > > > Friendship ) is one who walks in when the rest of the world walks
> away.
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > In Life, it doesn't matter who you are, but whether someone appreciates
> you
> > for what you are, accepts you and loves you unconditionally. A Real
> Friend (
> > Friendship ) is one who walks in when the rest of the world walks away.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
In Life, it doesn't matter who you are, but whether someone appreciates you
for what you are, accepts you and loves you unconditionally. A Real Friend (
Friendship ) is one who walks in when the rest of the world walks away.

Reply via email to