Re: Converting Java Code in JSP to JSTL
Thank you for helping me to learn different ways to construct a web link while passing a number of parameters along with it. Those hyperlinks forward a request and parameters to another servlet action. In this servlet action, do I receive those parameters in an usualy way? String sort = request.getParameter("sort"); String order = request.getParameter("order"); String offset = request.getParameter("offset"); Different Ways of Constructing a Hyperlink: Click Me Depending on how your Actions are setup you may be able to do this: Click Me James Mitchell gave this example a few weeks ago: ...later down the page... --- Ron Grabowski <[EMAIL PROTECTED]> wrote: > > 1. what is the JSTL equivalent of the <%else {%> > ... > > <%}%> tag? > > The c:choose, c:when, and c:otherwise tags: > > http://tinyurl.com/2kqlz > > > 2. how to write a tag to replace > the > > tag while passing a number of > > parameters? > > You could do this: > > > > > > > > > Click Me > > > Depending on how your Actions are setup you may be > able to do this: > > > Click Me > > > James Mitchell gave this example a few weeks ago: > > > class="java.util.HashMap"/> > > value="${dto.id}"/> > > value="edit"/> > > > > ...later down the page... > > > > > name="myLinkParams"> > > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Converting Java Code in JSP to JSTL
Caroline, Have you tried the following?: -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 1:12 AM To: Struts Users Mailing List Subject: Re: Converting Java Code in JSP to JSTL I pass an object ThreadBean from an action servlet in a request scope: request.setAttribute( "ThreadBean", threadBean ); In my JSP, there is no problem and everything works well if I use scripting element: <% ThreadBean threadBean = ( ThreadBean )request.getAttribute( "ThreadBean" ); %> I then re-write the above statement to: when I tried to use the properties of the threadBean: if ( threadID_int != threadBean.getThreadID() ) {} I got compilation error "illegal start of expression". Why JSTL does not work? --- Ron Grabowski <[EMAIL PROTECTED]> wrote: > > 1. what is the JSTL equivalent of the <%else {%> > ... > > <%}%> tag? > > The c:choose, c:when, and c:otherwise tags: > > http://tinyurl.com/2kqlz > > > 2. how to write a tag to replace > the > > tag while passing a number of > > parameters? > > You could do this: > > > > > > > > > Click Me > > > Depending on how your Actions are setup you may be > able to do this: > > > Click Me > > > James Mitchell gave this example a few weeks ago: > > > class="java.util.HashMap"/> > > value="${dto.id}"/> > > value="edit"/> > > > > ...later down the page... > > > > > name="myLinkParams"> > > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Converting Java Code in JSP to JSTL
I pass an object ThreadBean from an action servlet in a request scope: request.setAttribute( "ThreadBean", threadBean ); In my JSP, there is no problem and everything works well if I use scripting element: <% ThreadBean threadBean = ( ThreadBean )request.getAttribute( "ThreadBean" ); %> I then re-write the above statement to: when I tried to use the properties of the threadBean: if ( threadID_int != threadBean.getThreadID() ) {} I got compilation error "illegal start of expression". Why JSTL does not work? --- Ron Grabowski <[EMAIL PROTECTED]> wrote: > > 1. what is the JSTL equivalent of the <%else {%> > ... > > <%}%> tag? > > The c:choose, c:when, and c:otherwise tags: > > http://tinyurl.com/2kqlz > > > 2. how to write a tag to replace > the > > tag while passing a number of > > parameters? > > You could do this: > > > > > > > > > Click Me > > > Depending on how your Actions are setup you may be > able to do this: > > > Click Me > > > James Mitchell gave this example a few weeks ago: > > > class="java.util.HashMap"/> > > value="${dto.id}"/> > > value="edit"/> > > > > ...later down the page... > > > > > name="myLinkParams"> > > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Converting Java Code in JSP to JSTL
You could use: Click Me Threads: Thanks for all the supports and help that I have received so far on this topic. I have another question about the converstion of Java code: Click Me <%else {%> Threads: <%}%> 1. what is the JSTL equivalent of the <%else {%> ... <%}%> tag? 2. how to write a tag to replace the tag while passing a number of parameters? -Caroline --- Bill Siggelkow <[EMAIL PROTECTED]> wrote: > You cannot call static methods with JSTL 1.0. The > simplest option is to > create a JavaBean that you place in some application > scope that wraps > the static method call with a normal JavaBean getter > instance method. > > That being said, if you truly are formatting stuff > then use the JSTL > formatting tags if you can. If you are using JSTL > 1.1 then you can > create a function tag. Another alternative is to use > the "bind" tag in > the Jakarta Taglibs "unstandard" library ... > > All in all, your best bet is probably one of the > first two options (your > own JavaBean or use JSTL fmt library). > > Eric Schneider wrote: > > Can you use the JSTL tags to call static API? > > > > Something like this: > > > > value="StringUtils.abbreviate(${aTopic.subject}, > 30)"/> > > > > Is this possible? > > > > Thanks, > > Eric > > > > On Jun 26, 2004, at 5:48 AM, Pedro Salgado wrote: > > > >> On 04/06/26 1:33, "Michael McGrady" > <[EMAIL PROTECTED]> wrote: > >> > >>> Looks like a test, Caroline! > >>> > >>> At 05:20 PM 6/25/2004, Caroline Jen wrote: > >>> > I was told that JSTL can convert most of the > Java code > in JSP. I still have some problem with > initializing > variables and if statments; for example, I do > not know > how to write in JSTL of the following: > > 1. int i = 0; > >> > >> > >> > 2. i++; > >> > >> > >> > 3. String prevArticle = null; > >> > >> > >> > 4. if ( numberOfPosts - 1 == 1 ) {} > >> > >> > >> > 5. if ( nextTopic != 0 ) > >> > >> > >> > 6. String threadID = String.valueOf( > threadID_int ); > >> > >> > >> > 7. if ( threadRows.size() == 0 ) {} > >> > >> > >> > 8. if ( previousOffset >= 0 || nextOffset >= 0 > ) {} > >> > >> > >> > 9. if ( prevArticle != null ) && ( > !article.equals( > prevArticle ) ) {} > >> > >> > >> The article != preArticle I am not quite sure. > >> > >> Pedro Salgado > >> > >> > >> > - > >> To unsubscribe, e-mail: > [EMAIL PROTECTED] > >> For additional commands, e-mail: > [EMAIL PROTECTED] > >> > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Converting Java Code in JSP to JSTL
> 1. what is the JSTL equivalent of the <%else {%> ... > <%}%> tag? The c:choose, c:when, and c:otherwise tags: http://tinyurl.com/2kqlz > 2. how to write a tag to replace the > tag while passing a number of > parameters? You could do this: Click Me Depending on how your Actions are setup you may be able to do this: Click Me James Mitchell gave this example a few weeks ago: > > > > > ...later down the page... > > name="myLinkParams"> > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Converting Java Code in JSP to JSTL
Thanks for all the supports and help that I have received so far on this topic. I have another question about the converstion of Java code: Click Me <%else {%> Threads: <%}%> 1. what is the JSTL equivalent of the <%else {%> ... <%}%> tag? 2. how to write a tag to replace the tag while passing a number of parameters? -Caroline --- Bill Siggelkow <[EMAIL PROTECTED]> wrote: > You cannot call static methods with JSTL 1.0. The > simplest option is to > create a JavaBean that you place in some application > scope that wraps > the static method call with a normal JavaBean getter > instance method. > > That being said, if you truly are formatting stuff > then use the JSTL > formatting tags if you can. If you are using JSTL > 1.1 then you can > create a function tag. Another alternative is to use > the "bind" tag in > the Jakarta Taglibs "unstandard" library ... > > All in all, your best bet is probably one of the > first two options (your > own JavaBean or use JSTL fmt library). > > Eric Schneider wrote: > > Can you use the JSTL tags to call static API? > > > > Something like this: > > > > value="StringUtils.abbreviate(${aTopic.subject}, > 30)"/> > > > > Is this possible? > > > > Thanks, > > Eric > > > > On Jun 26, 2004, at 5:48 AM, Pedro Salgado wrote: > > > >> On 04/06/26 1:33, "Michael McGrady" > <[EMAIL PROTECTED]> wrote: > >> > >>> Looks like a test, Caroline! > >>> > >>> At 05:20 PM 6/25/2004, Caroline Jen wrote: > >>> > I was told that JSTL can convert most of the > Java code > in JSP. I still have some problem with > initializing > variables and if statments; for example, I do > not know > how to write in JSTL of the following: > > 1. int i = 0; > >> > >> > >> > 2. i++; > >> > >> > >> > 3. String prevArticle = null; > >> > >> > >> > 4. if ( numberOfPosts - 1 == 1 ) {} > >> > >> > >> > 5. if ( nextTopic != 0 ) > >> > >> > >> > 6. String threadID = String.valueOf( > threadID_int ); > >> > >> > >> > 7. if ( threadRows.size() == 0 ) {} > >> > >> > >> > 8. if ( previousOffset >= 0 || nextOffset >= 0 > ) {} > >> > >> > >> > 9. if ( prevArticle != null ) && ( > !article.equals( > prevArticle ) ) {} > >> > >> > >> The article != preArticle I am not quite sure. > >> > >> Pedro Salgado > >> > >> > >> > - > >> To unsubscribe, e-mail: > [EMAIL PROTECTED] > >> For additional commands, e-mail: > [EMAIL PROTECTED] > >> > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Converting Java Code in JSP to JSTL
You cannot call static methods with JSTL 1.0. The simplest option is to create a JavaBean that you place in some application scope that wraps the static method call with a normal JavaBean getter instance method. That being said, if you truly are formatting stuff then use the JSTL formatting tags if you can. If you are using JSTL 1.1 then you can create a function tag. Another alternative is to use the "bind" tag in the Jakarta Taglibs "unstandard" library ... All in all, your best bet is probably one of the first two options (your own JavaBean or use JSTL fmt library). Eric Schneider wrote: Can you use the JSTL tags to call static API? Something like this: Is this possible? Thanks, Eric On Jun 26, 2004, at 5:48 AM, Pedro Salgado wrote: On 04/06/26 1:33, "Michael McGrady" <[EMAIL PROTECTED]> wrote: Looks like a test, Caroline! At 05:20 PM 6/25/2004, Caroline Jen wrote: I was told that JSTL can convert most of the Java code in JSP. I still have some problem with initializing variables and if statments; for example, I do not know how to write in JSTL of the following: 1. int i = 0; 2. i++; 3. String prevArticle = null; 4. if ( numberOfPosts - 1 == 1 ) {} 5. if ( nextTopic != 0 ) 6. String threadID = String.valueOf( threadID_int ); 7. if ( threadRows.size() == 0 ) {} 8. if ( previousOffset >= 0 || nextOffset >= 0 ) {} 9. if ( prevArticle != null ) && ( !article.equals( prevArticle ) ) {} The article != preArticle I am not quite sure. Pedro Salgado - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Converting Java Code in JSP to JSTL
Have you looked at the format library for these kinds of situations? Example: -Original Message- From: Eric Schneider [mailto:[EMAIL PROTECTED] Sent: Monday, June 28, 2004 5:34 PM To: Struts Users Mailing List Subject: Re: Converting Java Code in JSP to JSTL Can you use the JSTL tags to call static API? Something like this: Is this possible? Thanks, Eric On Jun 26, 2004, at 5:48 AM, Pedro Salgado wrote: > On 04/06/26 1:33, "Michael McGrady" <[EMAIL PROTECTED]> wrote: > >> Looks like a test, Caroline! >> >> At 05:20 PM 6/25/2004, Caroline Jen wrote: >>> I was told that JSTL can convert most of the Java code >>> in JSP. I still have some problem with initializing >>> variables and if statments; for example, I do not know >>> how to write in JSTL of the following: >>> >>> 1. int i = 0; > >>> 2. i++; > >>> 3. String prevArticle = null; > >>> 4. if ( numberOfPosts - 1 == 1 ) {} > >>> 5. if ( nextTopic != 0 ) > >>> 6. String threadID = String.valueOf( threadID_int ); > >>> 7. if ( threadRows.size() == 0 ) {} > >>> 8. if ( previousOffset >= 0 || nextOffset >= 0 ) {} > >>> 9. if ( prevArticle != null ) && ( !article.equals( >>> prevArticle ) ) {} > > The article != preArticle I am not quite sure. > > Pedro Salgado > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Converting Java Code in JSP to JSTL
Can you use the JSTL tags to call static API? Something like this: Is this possible? Thanks, Eric On Jun 26, 2004, at 5:48 AM, Pedro Salgado wrote: On 04/06/26 1:33, "Michael McGrady" <[EMAIL PROTECTED]> wrote: Looks like a test, Caroline! At 05:20 PM 6/25/2004, Caroline Jen wrote: I was told that JSTL can convert most of the Java code in JSP. I still have some problem with initializing variables and if statments; for example, I do not know how to write in JSTL of the following: 1. int i = 0; 2. i++; 3. String prevArticle = null; 4. if ( numberOfPosts - 1 == 1 ) {} 5. if ( nextTopic != 0 ) 6. String threadID = String.valueOf( threadID_int ); 7. if ( threadRows.size() == 0 ) {} 8. if ( previousOffset >= 0 || nextOffset >= 0 ) {} 9. if ( prevArticle != null ) && ( !article.equals( prevArticle ) ) {} The article != preArticle I am not quite sure. Pedro Salgado - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Converting Java Code in JSP to JSTL
> >9. if ( prevArticle != null ) && ( !article.equals( > >prevArticle ) ) {} > > think, this is slightly different; the EL expression will be false for prevArticle=="" (java syntax) in EL you don't have to take care that prevArticle is not null to prevent a runtimeException. So if it aligns with your intention (it will also be true, iff one in article,prevArticle is null) hope i didn't confuse anything axel > > Good Luck! > > Bill Siggelkow > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Converting Java Code in JSP to JSTL
The article != preArticle I am not quite sure. At least in terms of how the el works (not nesting el). Cant see the point in porting this to JSTL unless there's nothing else to do. I'd sooner copy and past the java in the jsp page into an action like bill was saying. On 26 Jun 2004, at 11:48, Pedro Salgado wrote: On 04/06/26 1:33, "Michael McGrady" <[EMAIL PROTECTED]> wrote: Looks like a test, Caroline! At 05:20 PM 6/25/2004, Caroline Jen wrote: I was told that JSTL can convert most of the Java code in JSP. I still have some problem with initializing variables and if statments; for example, I do not know how to write in JSTL of the following: 1. int i = 0; 2. i++; 3. String prevArticle = null; 4. if ( numberOfPosts - 1 == 1 ) {} 5. if ( nextTopic != 0 ) 6. String threadID = String.valueOf( threadID_int ); 7. if ( threadRows.size() == 0 ) {} 8. if ( previousOffset >= 0 || nextOffset >= 0 ) {} 9. if ( prevArticle != null ) && ( !article.equals( prevArticle ) ) {} The article != preArticle I am not quite sure. Pedro Salgado - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Converting Java Code in JSP to JSTL
On 04/06/26 1:33, "Michael McGrady" <[EMAIL PROTECTED]> wrote: > Looks like a test, Caroline! > > At 05:20 PM 6/25/2004, Caroline Jen wrote: >> I was told that JSTL can convert most of the Java code >> in JSP. I still have some problem with initializing >> variables and if statments; for example, I do not know >> how to write in JSTL of the following: >> >> 1. int i = 0; >> 2. i++; >> 3. String prevArticle = null; >> 4. if ( numberOfPosts - 1 == 1 ) {} >> 5. if ( nextTopic != 0 ) >> 6. String threadID = String.valueOf( threadID_int ); >> 7. if ( threadRows.size() == 0 ) {} >> 8. if ( previousOffset >= 0 || nextOffset >= 0 ) {} >> 9. if ( prevArticle != null ) && ( !article.equals( >> prevArticle ) ) {} The article != preArticle I am not quite sure. Pedro Salgado - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Converting Java Code in JSP to JSTL
Caroline Jen wrote: I was told that JSTL can convert most of the Java code in JSP. Whoever told you that should be shot! It's not that JSTL is deficient, its just sort of like saying "I have heard that a honeydew melon can be used instead of a canteloupe." Theyr'e both round fruits, but they taste different. JSTL relies on scoped variable where the scopes are pageScope, requestScope, sessionScope, and applicationScope. To get the variables into these scopes should be the job of your actions. You can create these scoped variables using other things such as jsp:useBean and bean:define. However, the best place is your action, (or other things like PlugIn, SessionListener, etc.). I have not tested all of these so YMMV. I still have some problem with initializing variables and if statments; for example, I do not know how to write in JSTL of the following: 1. int i = 0; 0 2. i++; 3. String prevArticle = null; 4. if ( numberOfPosts - 1 == 1 ) {} 5. if ( nextTopic != 0 ) 6. String threadID = String.valueOf( threadID_int ); 7. if ( threadRows.size() == 0 ) {} 8. if ( previousOffset >= 0 || nextOffset >= 0 ) {} 9. if ( prevArticle != null ) && ( !article.equals( prevArticle ) ) {} Good Luck! Bill Siggelkow - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT -- for Martin: bounce backs from Brian Husted] Fwd: Undeliverable: Re: Converting Java Code in JSP to JSTL
These are the bounce backs we are getting, Martin, if you did not get the emails. Envelope-to: [EMAIL PROTECTED] Subject: Undeliverable: Re: Converting Java Code in JSP to JSTL Date: Fri, 25 Jun 2004 20:33:48 -0400 X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: Converting Java Code in JSP to JSTL Thread-Index: AcRbFT2tAfiE4XwbS5iyrTN3sew/LHCt From: "System Administrator" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> X-OriginalArrivalTime: 26 Jun 2004 00:33:33.0698 (UTC) FILETIME=[3651AE20:01C45B15] Your message To: Struts Users Mailing List <[EMAIL PROTECTED]>@[EMAIL PROTECTED]; [EMAIL PROTECTED]@[EMAIL PROTECTED] Subject: Re: Converting Java Code in JSP to JSTL Sent:Fri, 25 Jun 2004 20:33:17 -0400 did not reach the following recipient(s): Brian Husted on Sat, 26 Jun 2004 00:33:17 -0400 User Brian Husted/AMS/AMSINC (Brian Husted/AMS/[EMAIL PROTECTED]) not listed in public Name & Address Book Original-Envelope-ID: c=us;a= ;p=AMS;l={52F5B406-3C-040626003341Z-28290 Reporting-MTA: dns; CARNEY.ams.com Final-Recipient: RFC822; [EMAIL PROTECTED] Action: failed Status: 5.1.0 X-Display-Name: Brian Husted MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-class: urn:content-classes:message X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Subject: Re: Converting Java Code in JSP to JSTL Date: Fri, 25 Jun 2004 20:33:17 -0400 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Re: Converting Java Code in JSP to JSTL Thread-Index: AcRbFT2tAfiE4XwbS5iyrTN3sew/LA== From: "<[EMAIL PROTECTED]>@[EMAIL PROTECTED]" <[EMAIL PROTECTED]> To: "Struts Users Mailing List <[EMAIL PROTECTED]>@[EMAIL PROTECTED]" <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]@[EMAIL PROTECTED]" <[EMAIL PROTECTED]> Looks like a test, Caroline! At 05:20 PM 6/25/2004, Caroline Jen wrote: >I was told that JSTL can convert most of the Java code >in JSP. I still have some problem with initializing >variables and if statments; for example, I do not know >how to write in JSTL of the following: > >1. int i = 0; >2. i++; >3. String prevArticle = null; >4. if ( numberOfPosts - 1 == 1 ) {} >5. if ( nextTopic != 0 ) >6. String threadID = String.valueOf( threadID_int ); >7. if ( threadRows.size() == 0 ) {} >8. if ( previousOffset >= 0 || nextOffset >= 0 ) {} >9. if ( prevArticle != null ) && ( !article.equals( >prevArticle ) ) {} > >if anybody could kindly show me the JSTL equivalents? > > > > > >__ >Do you Yahoo!? >Yahoo! Mail - 50x more storage than other providers! >http://promotions.yahoo.com/new_mail > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Converting Java Code in JSP to JSTL
Looks like a test, Caroline! At 05:20 PM 6/25/2004, Caroline Jen wrote: I was told that JSTL can convert most of the Java code in JSP. I still have some problem with initializing variables and if statments; for example, I do not know how to write in JSTL of the following: 1. int i = 0; 2. i++; 3. String prevArticle = null; 4. if ( numberOfPosts - 1 == 1 ) {} 5. if ( nextTopic != 0 ) 6. String threadID = String.valueOf( threadID_int ); 7. if ( threadRows.size() == 0 ) {} 8. if ( previousOffset >= 0 || nextOffset >= 0 ) {} 9. if ( prevArticle != null ) && ( !article.equals( prevArticle ) ) {} if anybody could kindly show me the JSTL equivalents? __ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]