You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Nikola Milutinovic <Ni...@ev.co.yu> on 2003/06/04 07:25:56 UTC
Re: JSTL and EL question - SOLVED
> Oh boy, I get to contribute after asking a lot of questions! ; )
>
> Here's a query I am using in a current project:
>
> <sql:query var='picks' maxRows='1'>
> select * from contestant_picks where contestant='q' and week = ?
> order by entered desc
> <sql:param value='${thisWeek}'/>
> </sql:query>
It's good to know I'm not alone in using JSTL :-)
> I am using the maxRows option mainly because I don't need the db
> returning all of the older data. Hmm, now that I think about it I can
> probably add "and entered = max(entered)" or something like that.
> Anyway, what I learned was that . and [] differed in an important way.
> You can't evaluate a variable after the . but you can inside the []. As
> a result my code worked out to:
>
> <c:set var='gameNum' value='game${game.game}'/>
> <c:set var='thisPick' value='${picks.rows[0][gameNum]}'/>
>
> The gameNum variable will contain a string like "game1", "game2', etc.
> These are the names of the columns in the table. The second line
> replaces the gameNum variable inside the [] so I get the equivalent of
> "picks.rows[0].game1". One other piece you are missing is "rows" from
> the value. As a result the following code should work for your
> situation:
>
> <c:out value='${superData.rows[0][user_id]}'/>
Yes, I noticed that in the afternoon - silly me!
> I would highly recommend the book "core JSTL Mastering the JSP Standard
> Tab Library" by David M Geary from Sun. It got me up to speed on JSTL
> in less than a week. Now I can't wait for Tomcat 5 to support JSP 2.0.
Thanks for the advice.
Nix.
Re: is session id unique across webapps ?
Posted by Tim Funk <fu...@joedog.org>.
Tomcat creates its sessionids from a random number generator. The breadth of
random numbers is very wide allowing for "virtually" no overlaps. But since
they are random, dups may appear. Tomcat does have checks to make sure it
doesn't give out an existing session id in a particular webapp.
That being said, I think it is possible that the same session_id may be used
by two different users for two different webapps.
So if you really need a unique identifier, append session_id to context path.
There was a few discussions in developers list above session id uniqueness.
http://marc.theaimsgroup.com/?t=104072145900001&r=1&w=2
http://marc.theaimsgroup.com/?t=104207956000003&r=1&w=2
-Tim
siddharth wrote:
> Hi all,
>
> I am tring to find out about *uniqueness* of *session ids* which are
> generated by tomcat.
>
> are session ids are unique across webapps ???
> -----------------------------------------------
>
>
>
> thanx.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
is session id unique across webapps ?
Posted by siddharth <si...@fastmail.fm>.
Hi all,
I am tring to find out about *uniqueness* of *session ids* which are
generated by tomcat.
are session ids are unique across webapps ???
-----------------------------------------------
thanx.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org