RE: how do I use a LazyDynaBean as an ActionForm?

2006-07-11 Thread Yanroy

It's exactly the "lazy" part of the functionality that I need.  I have a
large and arbitrary (because they can be defined by the user) set of classes
that need fields populated inside them to configure them.  I'm assembling
the forms to get the user input based on the heirarchy of the class - they
all extend StatisticalAnalysis, so I include the .jsp fragment that presents
form fields for configuring that class's members, and then many of them also
extend FilteredAnalysis, so I intelligiently include or don't include the
jsp fragment for that, etc.  There's no way I can hope to keep the
struts-config.xml up to date with all the fields and potentially massive
number of different forms (also, by assembling the forms from fragments,
it's helpful for them to all use the same form name/type).

During the interim between my last post and your reply, I found a
LazyDynaActionForm implementation at
http://wiki.apache.org/struts/StrutsCatalogLazyList, which I came across
while searching for an answer to the exception I mentioned in my last post. 
Unfortunately, when using that, I get a "javax.servlet.jsp.JspException: No
getter method available for property filterField for bean under name
org.apache.struts.taglib.html.BEAN".  I'll ask around the lab about the
commons-validator thing... I'm not in charge of the libraries that get
distributed to the developers; if I can get that resolved, maybe I won't
have to deal with this new class.

Thanks very much for your help,
Ryan
-- 
View this message in context: 
http://www.nabble.com/how-do-I-use-a-LazyDynaBean-as-an-ActionForm--tf1925661.html#a5275174
Sent from the Struts - User forum at Nabble.com.


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



RE: how do I use a LazyDynaBean as an ActionForm?

2006-07-11 Thread Samere, Adam J
The class you are missing is part of the commons validator framework.
http://jakarta.apache.org/commons/validator/

commons-validator.jar is certainly a part of the core struts
distribution though. Make sure you include all the struts dependencies
for your version.

If all you need is to define ActionForms without writing concrete
ActionForm subclasses yourself you can use the
org.apache.struts.action.DynaActionForm. The lazy forms (DynaBean based)
allow you to get and set properties without defining them in the
form-bean declaration in struts-config.xml.

Adam

-Original Message-
From: Yanroy [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 11, 2006 1:53 PM
To: user@struts.apache.org
Subject: RE: how do I use a LazyDynaBean as an ActionForm?


I've seen the LazyValidatorForm referenced on a number of websites.  I
actually tried it before I tried the LazyDynaBean, but it causes an
exception.  Apparently there's some related class missing?  Here's what
I get from tomcat when I try to use it:

java.lang.NoClassDefFoundError:
org/apache/commons/validator/ValidatorException

The rest of the stack trace seems to indicate it's coming from a JSP,
presumably the one my strut forwards to.  My understanding of
LazyValidatorForm is that it is now a full part of struts, so I assume
it's in the struts libs, which are definately installed.  I'm obviously
missing something here...  Do I need to enable the validator?  I was
planning on doing validation myself inside the strut.

Thanks again,
Ryan
--
View this message in context:
http://www.nabble.com/how-do-I-use-a-LazyDynaBean-as-an-ActionForm--tf19
25661.html#a5274452
Sent from the Struts - User forum at Nabble.com.


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


-
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. Paychex, Inc.


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



RE: how do I use a LazyDynaBean as an ActionForm?

2006-07-11 Thread Yanroy

I've seen the LazyValidatorForm referenced on a number of websites.  I
actually tried it before I tried the LazyDynaBean, but it causes an
exception.  Apparently there's some related class missing?  Here's what I
get from tomcat when I try to use it:

java.lang.NoClassDefFoundError:
org/apache/commons/validator/ValidatorException

The rest of the stack trace seems to indicate it's coming from a JSP,
presumably the one my strut forwards to.  My understanding of
LazyValidatorForm is that it is now a full part of struts, so I assume it's
in the struts libs, which are definately installed.  I'm obviously missing
something here...  Do I need to enable the validator?  I was planning on
doing validation myself inside the strut.

Thanks again,
Ryan
-- 
View this message in context: 
http://www.nabble.com/how-do-I-use-a-LazyDynaBean-as-an-ActionForm--tf1925661.html#a5274452
Sent from the Struts - User forum at Nabble.com.


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



RE: how do I use a LazyDynaBean as an ActionForm?

2006-07-11 Thread Samere, Adam J
The class specified by the type attribute in your form bean must be a
concrete implementation of org.apache.struts.action.ActionForm (as the
signature of the Action.execute method indicates). 

You can create your own implementation of ActionForm backed by a
LazyDynaBean, or try org.apache.struts.validator.LazyValidatorForm.

-Adam

-Original Message-
From: Yanroy [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 11, 2006 12:39 PM
To: user@struts.apache.org
Subject: how do I use a LazyDynaBean as an ActionForm?


Hi,
You may recall I posted a message similar to this one several days ago.
I never received a reply, so I'm hoping that this shorter (and hopefully
simpler) version will get one.  I'm using a LazyDynaBean as the form
associated with a strut, which the docs seem to say will work by being
wrapped inside some other kind of ActionForm.  I haven't found any
examples online of exactly how to do this (none contain
struts-config.xml, strut and JSP all from the same app).  I'll give you
a couple lines from my
struts-config.xml:





I also specify some array fields in that bean, but I edited that out for
the sake of brevity.

I also have my action:




The real problem here is that I have no idea how to get the data out of
the LazyDynaBean.  In my action strut, the form parameter passed to the
handler is null.  To me, this indicates some kind of misconfiguration,
but I can't see what it could be.  I'd greatly appreciate any help you
can give... this problem is completely holding up my work (it's the last
part of the webapp I'm making).

Thank you very much,
Ryan

PS - If anyone cares, my previous message was titled "ActionForm is null
when using dynabean"
--
View this message in context:
http://www.nabble.com/how-do-I-use-a-LazyDynaBean-as-an-ActionForm--tf19
25661.html#a5273110
Sent from the Struts - User forum at Nabble.com.


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


-
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. Paychex, Inc.


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