• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

c:forEachToken

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
make use of <c:forEachToken>

select box create==========

<c:set var="setNum1"><c ut value="${fNum1}" /></c:set>

<select name="sNum">
<c:forEachToken var="num" items="00001/00002/00003/00004" delims="/">
<option value=" " <if test="{setNum1 == [num value]}"> selected </c:if>>
<c ut value="${num}" />
</option>
</c:forEachToken>
</select>


// help me!!
[num value]is array num[i] in JAVA.
but, JSTL express it.

[ February 12, 2006: Message edited by: Mijeong Yi ]

[ February 12, 2006: Message edited by: Mijeong Yi ]
[ February 12, 2006: Message edited by: Mijeong Yi ]
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are talking about c:forTokens, you should use "num" to check the value :
<c:if test="${setNum1 == num}">


[ February 12, 2006: Message edited by: Satou kurinosuke ]
 
Mijeong Yi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
compare setNum1 with each items.

setNum1 compare 00000
setNum1 compare 00001
:
:

I Can't speak english well. I'm sorry....
[ February 12, 2006: Message edited by: Mijeong Yi ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I Can't speak english well. I'm sorry....


It's ok. Me either

Have a look at the piece of code I have posted above,
and tell me what you think about it.
It compares setNum1 to each token taken from the list.
If it matches, the option will be selected.
 
Sheriff
Posts: 67645
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"dawn sky",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Mijeong Yi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. Thanks
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic