struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Tedone" <m_ted...@hotmail.com>
Subject RE: Logic tags and collections?
Date Tue, 11 Mar 2003 22:33:04 GMT
First of all I would suggest you to reverse the if order so that, it the
first if returns true, you don't' have to perform the other if
statements(Like now, to get to a consistent result, you should perform all
the three if statements); secondly, you could iterate trough the Collection
retrieved from the session[by means of
(java.util.YourCollection)session.getAttribute? By means of <bean:define
id="yourInternal" name="yourSessionScopeCollectionName"
type="java.util.YourCollection"?]

and, depending on how many if are satisfied by <logic:present>, you could
show the consistent links.

My 2 cents.

Marco

> -----Original Message-----
> From: niksa_os [mailto:niksa_os@hotmail.com] 
> Sent: Tuesday, March 11, 2003 4:37 PM
> To: Struts Users Mailing List
> Subject: Logic tags and collections?
> 
> 
> How can I make something like this with Struts or someone 
> have better idea?
> 
> I have few Admin: MainAdmin, UserAdmin, EmailAdmin.
> MainAdmin can do anything, UserAdmin manage users and emails, 
> and EmailAdmin make emails only.
> 
> So, I need this:
> -without Struts, I make Collection in session and
> 
> If session.getAdminTypeCollection contain MainAdmin {
>     do something
> If session.getAdminTypeCollection contain UserAdmin OR MainAdmin {
>     do something
> If session.getAdminTypeCollection contain EmailAdmin OR 
> UserAdmin OR MainAdmin {
>     do something
> } End EmailAdmin
> } End UserAdmin
> } End MainAdmin
> 
> For MainAdmin Collection:
> Collection.add(MainAdmin)
> Collection.add(UserAdmin)
> Collection.add(EmailAdmin)
> 
> For UserAdmin Collection:
> Collection.add(UserAdmin)
> Collection.add(EmailAdmin)
> 
> For EmailAdmin Collection:
> Collection.add(EmailAdmin)
> 
> -do something are links
> 
> MainAdmin see all links
> UserAdmin see UserAdmin and EmailAdmin links
> EmailAdmin only EmailAdmin links
> 
> I can't use role or principal or anything from JAAS.
> 
> So, I need somehow to check Coolection with logic:present or 
> some others tags?
> 
> Thanks.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message