Object bean = TagUtils.getInstance().lookup(pageContext, name, null);

Niall

----- Original Message ----- 
From: "Dean A. Hoover" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, August 06, 2004 5:34 PM
Subject: Re: very dynamic forms


> Most changes I've been making so far have had to do with
> ActionErrors. I have several custom tags I've developed and
> am a bit uncertain as to how to fix:
>
>         Object bean = RequestUtils.lookup(pageContext, name, null);
>
> The documentation says "[m]any utility methods previously found
> in org.apache.struts.utils.RequestUtils have been moved to
> org.apache.struts.taglibs.TagUtils or
org.apache.struts.utils.ModuleUtils".
>
> So, I first tried:
>
>          Object bean = TagUtils.lookup(pageContext, name, null);
>
> and got:
>
> CategoriesTag.java:31: non-static method
> lookup(javax.servlet.jsp.PageContext,java.lang.String,java.lang.String)
> cannot be referenced from a static context
>
> So, I figured I needed to create a TagUtils instance and did:
>
>         TagUtils tagUtils = new TagUtils();
>         Object bean = tagUtils.lookup(pageContext, name, null);
>
> and I got:
>
> CategoriesTag.java:31: TagUtils() has protected access in
> org.apache.struts.taglib.TagUtils
>
> Do you know how to fix this?
>
> Thanks very much.
> Dean
>
>
> Niall Pemberton wrote:
>
> >For me it was very painless and although there aren't lots of big
"killer"
> >features - there are IMO lots of little ones that make this a good
upgrade.
> >
> >Niall
> >
> >----- Original Message ----- 
> >From: "Dean A. Hoover" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Sent: Friday, August 06, 2004 4:49 PM
> >Subject: Re: very dynamic forms
> >
> >
> >
> >
> >>Thanks. I am looking at Niall's Lazy stuff, but I like your idea.
> >>I will add it to my list of investigations and experiments. I've
> >>written quite a bit to struts 1.1. Is there a downside to upgrading?
> >>
> >>Thanks.
> >>Dean
> >>
> >>Kevin A. Palfreyman wrote:
> >>
> >>
> >>
> >>>Dean,
> >>>I do a similar thing with Struts 1.1, and I use an ordinary struts form
> >>>(a subclass of ValidatorActionForm) that has a DynaBean as one of its
> >>>fields.  To match this, my DTO also has the same field as a DynaBean,
> >>>and we just have to be a bit more clever when we copy properties
between
> >>>the two.  The "schema" of the DynaBeans are configured entirely
> >>>separately from the rest of the Struts stuff, and should be fairly
> >>>easily done from a DB. In an upcoming version, the shape of the
> >>>DynaBeans will be determined from data from a remote corba service.
> >>>
> >>>Unfortunately, this is all product specific (closed source), so I can't
> >>>just pass it on (it wouldn't be useful to you anyway in its current
> >>>form).  But it should encourage you that it can be done.
> >>>
> >>>>From a quick read of his web page, Niall's Lazy stuff looks very
> >>>promising.  If I were starting again, I might have a look to see if
that
> >>>would fit.
> >>>
> >>>Good luck,
> >>>
> >>>Kev
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>-----Original Message-----
> >>>>From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
> >>>>Sent: 06 August 2004 15:47
> >>>>To: Struts Users Mailing List
> >>>>Subject: Re: very dynamic forms
> >>>>
> >>>>What I need to do is construct a form that has a variety of
> >>>>text input forms on it that are determined at run-time. I
> >>>>know how to do this in jsp but I need to provide an
> >>>>ActionForm that conforms to that form.
> >>>>I got several useful replies last night and am investigating them.
> >>>>
> >>>>Dean
> >>>>
> >>>>Michael McGrady wrote:
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>That makes sense, but his other comments seem to negate that.  He
> >>>>>says, e.g., that "[w]hat would come out of the query would
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>be label,
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>form position, variable name,etc, etc.".  These are things
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>that are on
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>the page form, not on some dynamic class handling the form.  He
> >>>>>specifically rejects dynamic class structures in fact when he says
> >>>>>that he has worked with DynaActionForm and ActionForm and that they
> >>>>>don't fit the bill.  I think he is focusing on the idea of having
> >>>>>changing variables on the page form and how to handle this on the
> >>>>>backend.  Is that right, Dean?
> >>>>>
> >>>>>Michael
> >>>>>
> >>>>>At 01:40 AM 8/6/2004, you wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>I thought that
> >>>>>>
> >>>>>>" I want to build one on-the-fly according to
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>"configuration" stuff
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>>stored in a database, that can change. "
> >>>>>>
> >>>>>>was pretty clear, especially after he pointed out the
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>DynaActionForms
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>>weren't what he was looking for because they came from
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>struts config.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>>But maybe it's just me - I'm used to wondering about what (weird
> >>>>>>stuff) I can do in Struts.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>>>>>At 05:00 PM 8/5/2004, you wrote:
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>>Suppose I want to construct a form based on a query to a
> >>>>>>>>>>>>database. What would come out of the query would
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>be label,
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>>>>>>>>form position, variable name, etc, etc. What would be the
> >>>>>>>>>>>>recommended way of building this under struts/tiles? I've
> >>>>>>>>>>>>been working with struts/tiles for a while now
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>and this is
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>>>>>>>>the first time this sort of requirement has come up. I've
> >>>>>>>>>>>>used DynaActionForm and ActionForm, but do not
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>see how this
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>>>>>>>>sort of thing fits either model.
> >>>>>>>>>>>>
> >>>>>>>>>>>>Any ideas?
> >>>>>>>>>>>>
> >>>>>>>>>>>>Dean Hoover
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>---------------------------------------------------------------------
> >>>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]
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >---------------------------------------------------------------------
> >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]
>
>
>



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

Reply via email to