tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <Wendy.Sm...@asu.edu>
Subject RE: Populating One <select> Based On The Value In Another
Date Tue, 06 May 2003 15:20:23 GMT
Michael wrote:
> Exactly.  It's a choice between doing it on the client
> side or enduring another round-trip to the server.  I
> know how to get it from the server, but I was hoping
> that I could send a java.util.Map down when the page
> is rendered and save myself a trip.

All the Java/JSP/JSTL code executes on the server, so I don't see where you
could "send" a Map down to the client side.  Maybe an applet?  You could
surely render the *contents* of the Map into a JavaScript data structure.
(Does JavaScript have a Map structure?) And then use client-side JavaScript
to populate the second drop-down once the user has made a selection from the
first.

> But this is the first time I've had the problem of
> populating one drop-down using the choice from
> another.  I know how to get the selection from the
> first box out of JavaScript.  Getting that value into
> JSTL and the EL is the thing that I'm fuzzy on.

It's one or the other.  Since JavaScript is client-side, and JSTL/EL is
server-side, you can't get the value out of JavaScript and into JSTL.  If
you want to save a trip to the server, then I don't believe JSTL will be of
any help.

How much of a load will this site be under?  Is an extra round trip to the
server really that important?  You may be going to a lot of trouble to avoid
something that isn't really going to be a problem.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message