You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by joe bonansinga <jb...@hotmail.com> on 2000/12/28 04:57:33 UTC
Control Structure tags
I am new to the whole jsp thing. Maybe people have already thought of this.
I have extensive cold fusion experience. Cold fusion uses a concept very
similar to tag libraries in the CFML language. One of the most powerful
aspects of the language are the <CFIF>, <CFLOOP>, <CFSWITCH>, etc control
structures. After looking at scriptlets, they are very messy. Are there any
plans to develop a "control structure" tag library with a similar purpose? A
simple example would be:
<jsp:if (some condition)>
do something
<jsp:else>
do something
</jsp:if>
Thanks,
Joe
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
Re: Control Structure tags
Posted by Hans Bergsten <ha...@gefionsoftware.com>.
joe bonansinga wrote:
>
> I am new to the whole jsp thing. Maybe people have already thought of this.
> I have extensive cold fusion experience. Cold fusion uses a concept very
> similar to tag libraries in the CFML language. One of the most powerful
> aspects of the language are the <CFIF>, <CFLOOP>, <CFSWITCH>, etc control
> structures. After looking at scriptlets, they are very messy. Are there any
> plans to develop a "control structure" tag library with a similar purpose? A
> simple example would be:
>
> <jsp:if (some condition)>
> do something
> <jsp:else>
> do something
> </jsp:if>
Something like this will likely be added to the JSP spec (or as a
separate spec) in the future. There's a Java Community Process (JCP)
project set up to define a set of standard actions, and conditional
actions are a likely result.
<http://java.sun.com/aboutJava/communityprocess/jsr/jsr_052_jsptaglib.html>
But you can find a lot of action elements like this today, for
instance in the Apache Struts project:
<http://jakarta.apache.org/struts/index.html>
Hans
--
Hans Bergsten hans@gefionsoftware.com
Gefion Software http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com
Re: Control Structure tags
Posted by "Joseph B. Ottinger" <jo...@epesh.com>.
It's already being addressed. Don't forget, though, that JSP tags are
required to be well-formed, so you're looking at an XSL-like structure
rather than a CF-like structure:
<cond:if expr="<%= myString.equals("myValue") %>">
<cond:true>
...
</cond:true>
<cond:false>
...
</cond:false>
</cond:if>
Switch/case statements are more logical, along these lines. While and
other loops are easier; www.orionserver.com has a tag lib that has
iteration tags for, um, Iterators already available.
On Thu, 28 Dec 2000, joe bonansinga wrote:
> I am new to the whole jsp thing. Maybe people have already thought of this.
> I have extensive cold fusion experience. Cold fusion uses a concept very
> similar to tag libraries in the CFML language. One of the most powerful
> aspects of the language are the <CFIF>, <CFLOOP>, <CFSWITCH>, etc control
> structures. After looking at scriptlets, they are very messy. Are there any
> plans to develop a "control structure" tag library with a similar purpose? A
> simple example would be:
>
> <jsp:if (some condition)>
> do something
> <jsp:else>
> do something
> </jsp:if>
>
> Thanks,
>
> Joe
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
-----------------------------------------------------------
Joseph B. Ottinger joeo@epesh.com
http://epesh.com/ IT Consultant