• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using tags in scriptlets

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,
allthough I know that the intention of TagLibs is different, I want to
use the functionality of a tag in a scriptlet. Is there a way to do that?
And when, what does the syntax look like?
To be more concrete:
I use the Jakarta-DB-Taglib. As usuallay I make a connection. And then I
want to check the existence of a specific userID before creating it.
so what I want to do is:
- make a query
- check the rowCount
And so I assumed there is a way to do something like
....
<% if(!<db:rowCount>.equals("0")) { %>
There's allready a user with that ID!
<% } %>
.
.
.
Can anyone help? :roll:
Thanks in advance!
Albert
 
Albert Schweitzer
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Everything's allright! I found it myself!
If anyone is interested, here is how you can manage it.
- make a connection with the concerning tag
- start a statement tag
- after query and the result-tags, you can then access the rowcount
in a scriptlet with
(Integer)pageContext.getAttribute ("org.apache.taglibs.dbtags.resultset.rowcount");
For some this will be obvious, for me it was some kind of tricky to find!
;-D
Greetz,
Albert
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic