You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Grant Ingersoll <gs...@syr.edu> on 2006/02/10 16:31:32 UTC
Auto generated JSP for beans
Hi,
I am a long time user of Struts, but am new to the mailing list.
I am using a LazyValidatorForm in Struts 1.2.7 and I am trying to setup
some configuration screens for some interfaces that have a fair number
of weights/properties. Additionally, there are several implementations
of the interfaces and they may vary from deployment to deployment. I
was wondering if anyone knows of any JSP tags that would allow me to
auto-generate the HTML input tags for the properties to these interface
implementations. I have seen this done for Swing based UIs (using
BeanInfo and bean introspection) and was wondering if there is a way to
do this in Struts? The server side handling is pretty straight forward
using the LazyValidatorForm and the BeanUtils classes. I would be happy
with one that simply output text input fields for now, but it would be
nice if it could output checkboxes for booleans, too. Has anyone
seen/used something like this? I have searched a fair amount, but
haven't found anything.
Thanks,
Grant
--
-------------------------------------------------------------------
Grant Ingersoll
Sr. Software Engineer
Center for Natural Language Processing
Syracuse University
School of Information Studies
335 Hinds Hall
Syracuse, NY 13244
http://www.cnlp.org
Voice: 315-443-5484
Fax: 315-443-6886
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Auto generated JSP for beans
Posted by Torgeir Veimo <to...@pobox.com>.
On Fri, 2006-02-10 at 10:31 -0500, Grant Ingersoll wrote:
> I
> was wondering if anyone knows of any JSP tags that would allow me to
> auto-generate the HTML input tags for the properties to these
> interface implementations.
I don't have any code that I can send you, but we do this for LDAP based
profiles. The simple answer is to iterate over each property, and
generate som output based on the type of property. This is easily done
using an iterate taglib, but the html template for each property is then
defined in your java code.
A second approach is to generate an xml description of the bean, then
transform the xml description using xslt. This allows you to define the
template for each property type more easily in xml itself.
The second approach also allows you more intermedia steps eg.
permissioning filter of the bean properties.
--
Torgeir Veimo <to...@pobox.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org