Well, I'm not sure the Struts tags (or Bean/PropertyUtils) can evaluate
SiteConstant.HOST.  The last time I remember that somebody asked about a
similar situation, I think the suggestion was to provide accessors for them. 
I know, it ain't what you wanna hear, but I guess they just weren't written
to work that way.

Hubert

--- Michael McGrady <[EMAIL PROTECTED]> wrote:
> The value of SiteConstant.HOST is just "host" and is merely the session 
> attribute key for the Host object, Herbert.  I could have just put in 
> "host" and "ecliplse_banner" but I have this fear of hard 
> coding.  LOL  Does that change your thoughts?
> 
> At 09:29 AM 4/23/2004, Hubert Rabago wrote:
> >Those tags are meant to work with JavaBeans-style classes.  I think
> there's
> >been lots of questions about accessing stuff like SiteConstant.HOST and
> >SiteConstant.ECLIPSE_BANNER, but I don't remember seeing a solution for
> that.
> >  One way around it (not that it's the best way) is to provide accessors
> that
> >directly give you what (Page)host.getPage(SiteConstant.ECLIPSE_BANNER)
> >returns.
> >
> >Hubert
> >
> >--- Michael McGrady <[EMAIL PROTECTED]> wrote:
> > >
> > > Thanks, Herbert, let me state more particularly what I am doing.  I
> want to
> >use Struts tags rather than
> > > JSP.  I know how to do things in JSP easily.  With the tags, outside of
> > > ActionForms, I am confused.  In JSP, I get my results as follows:
> > >
> > >
> > > <%
> > > Host host = (Host)session.getAttribute(SiteConstant.HOST);
> > > Page key = (Page)host.getPage(SiteConstant.ECLIPSE_BANNER);
> > > %>
> > >
> > > <%= key.getValue("bannerLeftBackgroundColor") %>
> > >
> > > I want to do with the Struts bean tag what I do now with JSP tags.  How
> do
> > > I do that?  This should be simple, but something is not working.  I am
> > > either erring with the "define" or the "write" attribute and all the
> > > combinations I try don't work.  People have indicated that I need to
> > > retrieve a Map object with getMap().  I don't see why, given what I
> read in
> > >
> > > the literature.  If you could help, I would be eternally (or a very
> long
> > > time) grateful. The classes are given below:
> > >
> > > public class Host {
> > >    private Map pages;
> > >
> > >    public Host() {
> > >      int size = 89;
> > >      this.pages = Collections.synchronizedMap(new HashMap(size));
> > >    }
> > >
> > >    public void setMap(Map pages) {
> > >      this.pages = pages;
> > >    }
> > >
> > >    public Map getMap() {
> > >      return pages;
> > >    }
> > >
> > >    public void setPage(Object key, Object page) {
> > >      pages.put(key,page);
> > >    }
> > >
> > >    public Object getPage(Object key) {
> > >      return pages.get(key);
> > >    }
> > > } ///;-) Michael McGrady
> > >
> > >
> > > public class Page {
> > >    private Map keys;
> > >
> > >    public Page() {
> > >      int size = 89;
> > >      this.keys = Collections.synchronizedMap(new HashMap(size));
> > >    }
> > >
> > >    public void setMap(Map keys) {
> > >      this.keys = keys;
> > >    }
> > >
> > >    public Map getMap() {
> > >      return keys;
> > >    }
> > >
> > >    public void setValue(Object key, Object value) {
> > >      keys.put(key,value);
> > >    }
> > >
> > >    public Object getValue(Object key) {
> > >      Object value = keys.get(key);
> > >      com.crackwillow.log.StdOut.redirect("log.VALUE: " + value);
> > >      if(value == null) {
> > >        return "? [" + (String)key + "] ?";
> > >      } else {
> > >        return value;
> > >      }
> > >    }
> > > } ///;-) Michael McGrady
> > >
> > >
> >
> >
> >
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >Yahoo! Photos: High-quality 4x6 digital prints for 25¢
> >http://photos.yahoo.com/ph/print_splash
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



        
                
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to