You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Benjamin Stewart <bs...@waterwerks.com.au> on 2003/06/30 01:32:57 UTC

Sturts - Custom Tags and limitations

Greetings,
Before I go charging off and make a stack of custom tags, I thought I 
would post to the group to make sure I am heading in the right direction.

We are devloping an applicaton and we have created the business logic 
that is able to fit a number of UI (web, Local application etc). A 
number of our classes have methods that are not bean compliant 
(addCategory for example). Many of the functions also return objects and 
datastructures like linked lists and hash maps. As I understand it 
struts is happy to use beans, but if I am using an object and make a 
method call that is not bean compliant I am going to have to create my 
own tag library to deal with this.

For example, I have a bean function that returns a linked hash map, in 
order for me to itterate through this and display an output I will need 
to create my own tag library right?

Any advice appreciated.

Regards
Ben Stewart





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


RE: Sturts - Custom Tags and limitations

Posted by Steve Raeburn <st...@ninsky.com>.
No, isHuman()is an acceptable name for a getter.

getXXX, setXXX and isXXX (for boolean properties) are all valid. You can
also use indexed properties getXXX(int i) etc.

http://java.sun.com/products/javabeans/docs/spec.html

However, beans being processed by the view should be simple value objects
(Data Transfer Objects). A class that is checking the database sound like
part of the business or data access layers.

http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.html

Steve

> -----Original Message-----
> From: Benjamin Stewart [mailto:bstewart@waterwerks.com.au]
> Sent: June 29, 2003 6:01 PM
> To: Struts Users Mailing List
> Subject: Re: Sturts - Custom Tags and limitations
>
>
> Just strange that I have always thought of a setter and getter with
> reference to setting or getting a class field.
>
> But if I have a get function that is in a bean that is not used in
> reference to a particular field, feels wrong to me.
>
> For example I have a class person which has field name I am happy to
> have getName, setName. But if I have a function called isHuman which
> runs off and check my database which contains a list of humans, if it
> was to be bean accessible I would have to call it getIsHuman  right ??
>
> Ben



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


Re: Sturts - Custom Tags and limitations

Posted by Benjamin Stewart <bs...@waterwerks.com.au>.
Just strange that I have always thought of a setter and getter with 
reference to setting or getting a class field.

But if I have a get function that is in a bean that is not used in 
reference to a particular field, feels wrong to me.

For example I have a class person which has field name I am happy to 
have getName, setName. But if I have a function called isHuman which 
runs off and check my database which contains a list of humans, if it 
was to be bean accessible I would have to call it getIsHuman  right ??

Ben

Steve Raeburn wrote:

>The zero argument and serializable requirements are for there for persisting
>and re-instantiating beans. I guess without the zero arg constructor it's
>not *technically* a bean but I won't tell if you don't ;-)
>
>As long as you follow the bean naming conventions for setters & getters
>you'll be OK.
>
>Steve
>
>  
>
>>-----Original Message-----
>>From: Benjamin Stewart [mailto:bstewart@waterwerks.com.au]
>>Sent: June 29, 2003 5:23 PM
>>To: Struts Users Mailing List
>>Subject: Re: Sturts - Custom Tags and limitations
>>
>>
>>In order to make our classes bean compliant we would have to change our
>>constructors so they dont take parameters right ?? That is a pretty
>>severe limitation, or are you saying just make your method calls bean
>>compliant?
>>Ben
>>
>>Steve Raeburn wrote:
>>
>>    
>>
>>>Struts (and JSTL) will be happy with a LinkedHashMap as it is a member of
>>>the Collection class hierarchy.
>>>
>>>I would not recommend with custom tags unless you need custom
>>>      
>>>
>>functionality.
>>    
>>
>>>If you really can't change the existing method names you should consider
>>>adding additional methods that are bean compliant (they can just
>>>      
>>>
>>delegate to
>>    
>>
>>>the existing methods). You should consider deprecating the old methods so
>>>they could be removed in future.
>>>
>>>If you can't touch the existing classes at all (why?), think about using
>>>adaptor classes.
>>>
>>>Steve
>>>
>>>
>>>
>>>      
>>>
>>>>-----Original Message-----
>>>>From: Benjamin Stewart [mailto:bstewart@waterwerks.com.au]
>>>>Sent: June 29, 2003 4:33 PM
>>>>To: Struts Users Mailing List
>>>>Subject: Sturts - Custom Tags and limitations
>>>>
>>>>
>>>>Greetings,
>>>>Before I go charging off and make a stack of custom tags, I thought I
>>>>would post to the group to make sure I am heading in the right
>>>>        
>>>>
>>direction.
>>    
>>
>>>>We are devloping an applicaton and we have created the business logic
>>>>that is able to fit a number of UI (web, Local application etc). A
>>>>number of our classes have methods that are not bean compliant
>>>>(addCategory for example). Many of the functions also return objects and
>>>>datastructures like linked lists and hash maps. As I understand it
>>>>struts is happy to use beans, but if I am using an object and make a
>>>>method call that is not bean compliant I am going to have to create my
>>>>own tag library to deal with this.
>>>>
>>>>For example, I have a bean function that returns a linked hash map, in
>>>>order for me to itterate through this and display an output I will need
>>>>to create my own tag library right?
>>>>
>>>>Any advice appreciated.
>>>>
>>>>Regards
>>>>Ben Stewart
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>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
>>>
>>>
>>>
>>>      
>>>
>>
>>---------------------------------------------------------------------
>>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
>
>  
>



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


Re: Submiting a form through a link

Posted by Cristiano Moreira Silva <cr...@yahoo.com.br>.
Hey! Thank you everybody who help me! It works now.



----- Original Message -----
From: "Steve Raeburn" <st...@ninsky.com>
To: "Struts Users Mailing List"
<st...@jakarta.apache.org>
Sent: Sunday, June 29, 2003 5:50 PM
Subject: RE: Submiting a form through a link


> Good point!
>
> <html:form action="/path">
>     <html:select property="choice" value="1">
>         <html:option value="1">1</html:option>
>         <html:option value="2">2</html:option>
>         <html:option value="3">3</html:option>
>         <html:option value="4">4</html:option>
>     </html:select>
>
> </html:form>
>
> <a href=""
onclick="document.forms[0].submit();return false;">[
ok ]</a>
> <html:link href=""
onclick="javascript:'document.forms[0].submit();return
> false;'">[ ok ]</html:link>
> <a href="javascript:document.forms[0].submit()">[ ok
]</a>
>
> All three versions of the link work. A couple of
points to notice:
>   - The links don't have to be contained within the
form tag. Not sure if
> you were under that impression or not, but they
don't.
>   - The third version uses the 'javascript:' url in
href. You don't need
the
> return false; here because you want the link to
activate (it won't
actually
> work if you do include return false;)
>
> Rhetorical question: What's wrong with a simple
button? Then you wouldn't
> need to resort to javascript and all users would be
able to use the form.
>
> Steve
>
> > -----Original Message-----
> > From: José Ventura [mailto:ventura@cit.com.br]
> > Sent: June 29, 2003 1:20 PM
> > To: struts-user@jakarta.apache.org
> > Subject: Re: Submiting a form through a link
> >
> >
> > Have you gotten any JS errors when you clicked on
it? I believe you
> > don't need the "javascript:" part when it's inside
an eventhandler
> > (onXXX), only when it's inside an href.
> >
> > Try <html:link href="" onclick="go()">[ ok
]</html:link>, see if it
> > works...
> >
> > HTH
> >
> > []'s
> > - ventura
> >
> > ----- Original Message -----
> > From: "Cristiano Moreira Silva"
<cr...@yahoo.com.br>
> > To: <st...@jakarta.apache.org>
> > Sent: Sunday, June 29, 2003 5:12 PM
> > Subject: Re: Submiting a form through a link
> >
> >
> > > It's just something like this:
> > >
> > > function go()
> > >     document.forms[0].submit();
> > > }
> > >
> > > <html:form action="/some_action">
> > >     <html:select property="choice" value="1">
> > >         <html:option value="1"/>
> > >         <html:option value="2"/>
> > >         <html:option value="3"/>
> > >         <html:option value="4"/>
> > >     </html:select>
> > >
> > >    <html:link href=""
onclick="javascript:go()">[ ok
> > > ]</html:link>
> > > </html:form>
> > >
> > > What's wrong with this implementation. It
happens
> > > nothing when I click in
> > > the "[ ok ]" link.
> > > But I'll try your tip. Thanks.
> > >
> > > ----- Original Message -----
> > > From: "Steve Raeburn" <st...@ninsky.com>
> > > To: "Struts Users Mailing List"
> > > <st...@jakarta.apache.org>
> > > Sent: Sunday, June 29, 2003 2:20 PM
> > > Subject: RE: Submiting a form through a link
> > >
> > >
> > > > You don't need to use <html:link> because the
link
> > > doesn't actually link
> > > to
> > > > anything, it just triggers the form
submission. The
> > > path to your action is
> > > > actually in the <html:form> tag. The
parameters that
> > > would normally be
> > > added
> > > > to the URL are specified in the hidden fields.
> > > >
> > > > If that's still not clear it would help if you
> > > posted some of your code so
> > > I
> > > > can better understand what you are trying to
do.
> > > >
> > > > Steve
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Cristiano Moreira Silva
> > > [mailto:crisbrsp@yahoo.com.br]
> > > > > Sent: June 29, 2003 9:14 AM
> > > > > To: struts-user@jakarta.apache.org
> > > > > Subject: Re: Submiting a form through a link
> > > > >
> > > > >
> > > > > First of all, thanks for helping me, but
I've one
> > > > > doubt: in the example
> > > > > below (the one you sent me), you aren't
using
> > > > > <html:link> but <html:hidden>
> > > > > instead.  Where I put my link reference?
Thanks
> > > again.
> > > > >
> > > > >  <html:form action="/path">
> > > > >      <html:hidden property="action"
> > > value="MyAction"/>
> > > > >  </html:form>
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Steve Raeburn" <st...@ninsky.com>
> > > > > To: "Struts Users Mailing List"
> > > > > <st...@jakarta.apache.org>
> > > > > Sent: Saturday, June 28, 2003 6:17 PM
> > > > > Subject: RE: Submiting a form through a link
> > > > >
> > > > >
> > > > > >   <a href=""
> > > > > onclick="document.forms[0].submit();return
> > > > > false;">Click
> > > > > > here</a>
> > > > > >   (or the equivalent using Struts
<html:link>
> > > tag.)
> > > > > >
> > > > > >   <html:form action="/path">
> > > > > >     <html:hidden property="action"
> > > > > value="MyAction"/>
> > > > > >   </html:form>
> > > > > >
> > > > > > The above code works for me. Not sure if
the
> > > return
> > > > > false; has any
> > > > > impact -
> > > > > > probably does nothing.
> > > > > > Do you have more than one form on the
page? You
> > > > > might need to change the
> > > > > > forms[] index number.
> > > > > > You can also try using the form name
(which is
> > > the
> > > > > same as defined in
> > > > > > struts-config.xml) e.g.
> > > > > >
> > > > > >   document.forms['testForm'].submit()
> > > > > >
> > > > > > If that doesn't work then please post more
of
> > > your
> > > > > form & link code.
> > > > > >
> > > > > > Steve
> > > > > >
> > > > > > p.s. Don't forget that if your users don't
have
> > > > > javascript enabled then
> > > > > they
> > > > > > won't be able to use this feature of your
site.
> > > ;-)
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Cristiano Moreira Silva
> > > > > [mailto:crisbrsp@yahoo.com.br]
> > > > > > > Sent: June 28, 2003 12:02 PM
> > > > > > > To: Struts Users Mailing List
> > > > > > > Subject: Submiting a form through a link
> > > > > > >
> > > > > > >
> > > > > > > Hello. I'm trying to submit a html:form
> > > through a
> > > > > > > html:link. When I click the link, on the
> > > onclick
> > > > > > > event, I call a javascript function and
> > > execute:
> > > > > > >
> > > > > > > document.forms[0].submit()
> > > > > > >
> > > > > > > Then nothing happens.
> > > > > > >
> > > > > > > Can someone send me a simple example (or
a URL
> > > to
> > > > > it)
> > > > > > > of submiting a html:form through
html:link?
> > > > > Thanks.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > =====
> > > > > > >
> > > > >
> > >
____________________________________________________________
> > > > > > > Cristiano Moreira Silva
> > > > > > > Site -
http://computologo.vila.bol.com.br
> > > > > > > E-mail - crisbrsp@yahoocom.br
> > > > > > > "Tudo posso nAquele que me fortalece."
Fp.
> > > 4:13
> > > > > > >
> > > > > > >
> > > > >
> > >
_______________________________________________________________________
> > > > > > > Yahoo! Mail
> > > > > > > Mais espaço, mais segurança e gratuito:
caixa
> > > > > postal de 6MB,
> > > > > > > antivírus, proteção contra spam.
> > > > > > > http://br.mail.yahoo.com/
> > > > > > >
> > > > > > >
> > > > >
> > >
---------------------------------------------------------------------
> > > > > > > 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
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > =====
> > > > >
> > >
____________________________________________________________
> > > > > Cristiano Moreira Silva
> > > > > Site - http://computologo.vila.bol.com.br
> > > > > E-mail - crisbrsp@yahoocom.br
> > > > > "Tudo posso nAquele que me fortalece." Fp.
4:13
> > > > >
> > > > >
> > >
_______________________________________________________________________
> > > > > Yahoo! Mail
> > > > > Mais espaço, mais segurança e gratuito:
caixa
> > > postal de 6MB,
> > > > > antivírus, proteção contra spam.
> > > > > http://br.mail.yahoo.com/
> > > > >
> > > > >
> > >
---------------------------------------------------------------------
> > > > > 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
> > >
> > >
> > >
> > >
> > > =====
> > >
____________________________________________________________
> > > Cristiano Moreira Silva
> > > Site - http://computologo.vila.bol.com.br
> > > E-mail - crisbrsp@yahoocom.br
> > > "Tudo posso nAquele que me fortalece." Fp. 4:13
> > >
> > >
_______________________________________________________________________
> > > Yahoo! Mail
> > > Mais espaço, mais segurança e gratuito: caixa
postal de 6MB,
antivírus,
> > proteção contra spam.
> > > http://br.mail.yahoo.com/
> > >
> > >
---------------------------------------------------------------------
> > > 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
> >
> >
> >
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
struts-user-help@jakarta.apache.org




=====
____________________________________________________________
Cristiano Moreira Silva
Site - http://computologo.vila.bol.com.br
E-mail - crisbrsp@yahoocom.br
"Tudo posso nAquele que me fortalece." Fp. 4:13

_______________________________________________________________________
Yahoo! Mail
Mais espaço, mais segurança e gratuito: caixa postal de 6MB, antivírus, proteção contra spam.
http://br.mail.yahoo.com/

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


RE: Sturts - Custom Tags and limitations

Posted by Steve Raeburn <st...@ninsky.com>.
The zero argument and serializable requirements are for there for persisting
and re-instantiating beans. I guess without the zero arg constructor it's
not *technically* a bean but I won't tell if you don't ;-)

As long as you follow the bean naming conventions for setters & getters
you'll be OK.

Steve

> -----Original Message-----
> From: Benjamin Stewart [mailto:bstewart@waterwerks.com.au]
> Sent: June 29, 2003 5:23 PM
> To: Struts Users Mailing List
> Subject: Re: Sturts - Custom Tags and limitations
>
>
> In order to make our classes bean compliant we would have to change our
> constructors so they dont take parameters right ?? That is a pretty
> severe limitation, or are you saying just make your method calls bean
> compliant?
> Ben
>
> Steve Raeburn wrote:
>
> >Struts (and JSTL) will be happy with a LinkedHashMap as it is a member of
> >the Collection class hierarchy.
> >
> >I would not recommend with custom tags unless you need custom
> functionality.
> >If you really can't change the existing method names you should consider
> >adding additional methods that are bean compliant (they can just
> delegate to
> >the existing methods). You should consider deprecating the old methods so
> >they could be removed in future.
> >
> >If you can't touch the existing classes at all (why?), think about using
> >adaptor classes.
> >
> >Steve
> >
> >
> >
> >>-----Original Message-----
> >>From: Benjamin Stewart [mailto:bstewart@waterwerks.com.au]
> >>Sent: June 29, 2003 4:33 PM
> >>To: Struts Users Mailing List
> >>Subject: Sturts - Custom Tags and limitations
> >>
> >>
> >>Greetings,
> >>Before I go charging off and make a stack of custom tags, I thought I
> >>would post to the group to make sure I am heading in the right
> direction.
> >>
> >>We are devloping an applicaton and we have created the business logic
> >>that is able to fit a number of UI (web, Local application etc). A
> >>number of our classes have methods that are not bean compliant
> >>(addCategory for example). Many of the functions also return objects and
> >>datastructures like linked lists and hash maps. As I understand it
> >>struts is happy to use beans, but if I am using an object and make a
> >>method call that is not bean compliant I am going to have to create my
> >>own tag library to deal with this.
> >>
> >>For example, I have a bean function that returns a linked hash map, in
> >>order for me to itterate through this and display an output I will need
> >>to create my own tag library right?
> >>
> >>Any advice appreciated.
> >>
> >>Regards
> >>Ben Stewart
> >>
> >>
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>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
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> 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


Re: Sturts - Custom Tags and limitations

Posted by Benjamin Stewart <bs...@waterwerks.com.au>.
In order to make our classes bean compliant we would have to change our 
constructors so they dont take parameters right ?? That is a pretty 
severe limitation, or are you saying just make your method calls bean 
compliant?
Ben

Steve Raeburn wrote:

>Struts (and JSTL) will be happy with a LinkedHashMap as it is a member of
>the Collection class hierarchy.
>
>I would not recommend with custom tags unless you need custom functionality.
>If you really can't change the existing method names you should consider
>adding additional methods that are bean compliant (they can just delegate to
>the existing methods). You should consider deprecating the old methods so
>they could be removed in future.
>
>If you can't touch the existing classes at all (why?), think about using
>adaptor classes.
>
>Steve
>
>  
>
>>-----Original Message-----
>>From: Benjamin Stewart [mailto:bstewart@waterwerks.com.au]
>>Sent: June 29, 2003 4:33 PM
>>To: Struts Users Mailing List
>>Subject: Sturts - Custom Tags and limitations
>>
>>
>>Greetings,
>>Before I go charging off and make a stack of custom tags, I thought I
>>would post to the group to make sure I am heading in the right direction.
>>
>>We are devloping an applicaton and we have created the business logic
>>that is able to fit a number of UI (web, Local application etc). A
>>number of our classes have methods that are not bean compliant
>>(addCategory for example). Many of the functions also return objects and
>>datastructures like linked lists and hash maps. As I understand it
>>struts is happy to use beans, but if I am using an object and make a
>>method call that is not bean compliant I am going to have to create my
>>own tag library to deal with this.
>>
>>For example, I have a bean function that returns a linked hash map, in
>>order for me to itterate through this and display an output I will need
>>to create my own tag library right?
>>
>>Any advice appreciated.
>>
>>Regards
>>Ben Stewart
>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>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
>
>  
>



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


RE: Sturts - Custom Tags and limitations

Posted by Steve Raeburn <st...@ninsky.com>.
Should read: I would not recommend creating custom tags...

Steve


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


RE: Sturts - Custom Tags and limitations

Posted by Steve Raeburn <st...@ninsky.com>.
I also misspoke. LinkedHashMap is, of course, not a Collection class but it
does work.

Been a long day for some reason ;-)

Steve



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


RE: Sturts - Custom Tags and limitations

Posted by Steve Raeburn <st...@ninsky.com>.
Struts (and JSTL) will be happy with a LinkedHashMap as it is a member of
the Collection class hierarchy.

I would not recommend with custom tags unless you need custom functionality.
If you really can't change the existing method names you should consider
adding additional methods that are bean compliant (they can just delegate to
the existing methods). You should consider deprecating the old methods so
they could be removed in future.

If you can't touch the existing classes at all (why?), think about using
adaptor classes.

Steve

> -----Original Message-----
> From: Benjamin Stewart [mailto:bstewart@waterwerks.com.au]
> Sent: June 29, 2003 4:33 PM
> To: Struts Users Mailing List
> Subject: Sturts - Custom Tags and limitations
>
>
> Greetings,
> Before I go charging off and make a stack of custom tags, I thought I
> would post to the group to make sure I am heading in the right direction.
>
> We are devloping an applicaton and we have created the business logic
> that is able to fit a number of UI (web, Local application etc). A
> number of our classes have methods that are not bean compliant
> (addCategory for example). Many of the functions also return objects and
> datastructures like linked lists and hash maps. As I understand it
> struts is happy to use beans, but if I am using an object and make a
> method call that is not bean compliant I am going to have to create my
> own tag library to deal with this.
>
> For example, I have a bean function that returns a linked hash map, in
> order for me to itterate through this and display an output I will need
> to create my own tag library right?
>
> Any advice appreciated.
>
> Regards
> Ben Stewart
>
>
>
>
>
> ---------------------------------------------------------------------
> 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