[prev in list] [next in list] [prev in thread] [next in thread] 

List:       taglibs-user
Subject:    Re: [JSTL] Help hiding/showing sections on JSP (w/ cookie?)
From:       "Affan Qureshi" <quereshi () etilize ! com>
Date:       2002-12-21 15:20:14
[Download RAW message or body]

A great example is there at:
http://www.keyboardmonkey.com/StrutMonkey/MonkeyStruts_v2.jsp

I have also implemented Show All and Hide All using the same technique.
Works sweet.

Affan

----- Original Message -----
From: "Martin Cooper" <martinc@apache.org>
To: "Tag Libraries Users List" <taglibs-user@jakarta.apache.org>
Sent: Saturday, December 21, 2002 4:55 AM
Subject: RE: [JSTL] Help hiding/showing sections on JSP (w/ cookie?)


>
>
> On Fri, 20 Dec 2002, Wendy Smoak wrote:
>
> > > I've heard tell of folks serializing things such as this.  If you're
not
> > > in a distributed environment (or you somehow manage to have a shared
> > > directory available to all nodes of the "cluser") you could probably
do
> > > the same.
> > > Doing something along these lines would not only reduce the load on
the
> > > DB, but enable the user the priviledge of having the same settings on
> > > every machine they visited the site from.
> >
> > You guys are full of ideas!  I went with a boring old boolean[] that
gets
> > filled up like so:
> >       boolean[] profileSections = new boolean[ cookieValue.length ];
> >       for (int i = 0; i< cookieValue.length ; i++ ) {
> >          profileSections[i] = (cookieValue[i] == 'Y' ? true : false );
> >       }
> > and then stuck in the request:
> >       request.setAttribute( "profileSections" , profileSections );
> >
> > The JSP code then checks to see if it should display a particular
section:
> > <c:if test="${profileSections[0]}">
> >   <table>...</table>
> > </c:if>
> >
> > The bean with well-named methods is a much better idea, but this was
easy
> > enough without adding another class.  I really wanted to stay out of the
> > database for this part.
>
> You could use a DynaBean to avoid writing code for the JavaBean itself...
>
> --
> Martin Cooper
>
>
> >
> > Thanks!  I really couldn't find the right place to ask about this, so I
> > appreciate your help even though it isn't strictly on topic.
> >
> > --
> > Wendy Smoak
> > Applications Systems Analyst, Sr.
> > Arizona State University PA Information Resources Management
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:taglibs-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic