I submitted an if/else and switch/case set of tags a couple of weeks ago
under the Struts developer list.
http://www.mail-archive.com/[email protected]/msg01372.html
It uses three tags If, Then & Else (based on existing Struts CompareTagBase
logic)
<logic:if op="GreaterThan" name="testbean" property="doubleProperty"
value="400">
<logic:then>
Property Greater Than Value
</logic:then>
<logic:else>
Property Not Greater Than Value
</logic:else>
</logic:if>
Does this come under the "really ugly" category or will you consider it for
Struts?
Niall
> -----Original Message-----
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: 31 May 2001 04:18
> To: '[EMAIL PROTECTED]'
> Subject: RE: Help me defend Struts taglibs!!!
>
>
>
>
> On Thu, 26 Apr 2001, Scott Cressler wrote:
>
> > One thing this argument might come down to is why custom tags,
> especially
> > for "if...else" stuff (which, BTW, IMHO is not handled real well by the
> > struts tags...would be nicer to have more flexibility in the
> conditions you
> > can check and to have the ability to do else, rather than
> > <logic:equal>...</logic:equal><logic:notEqual>...</logic:notEqual>...but
> > that's another discussion :-). In other words, if it is so easy to just
> > slap some Java in their to do some conditional stuff, why use a
> clumsy tag.
> >
>
> It turns out to be surprisingly difficult to come up with syntax for an
> "else" construct that is legal XML syntax and isn't really ugly.
>
> There's currently work going on in the JSP Standard Tag Library effort
> (JSR-052) to create tags that will eventually be known to all containters
> in the same way that tags like <jsp:useBean> are -- which will also deal
> with a lot of the performance related concerns. It looks like there will
> be reasonable ways to do "switch" and "if-else" type processing with them.
>
> In the mean time, we can reconsider adding an "else" capability in Struts
> 1.1, if someone can come up with a good syntax.
>
> Craig
>
>