You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Mike D <d0...@yahoo.com> on 2002/02/10 11:11:05 UTC
extending the Struts custom tags
we have developed a framework on our project which dynamically writes out
correct tags on the page, including "value" data and properties. For example:
<xx:cmp name="person" property="name"> could either write out an anchor tag
or just the value of the person's name property - depending on permissions
set for the current user. The tag property name "person" is the name of the
"person" bean in the request.
I can't figure out how to couple this with struts ActionForms.
I can see these 2 possible solutions:
1. Extend the Struts custom tags to incorporate our component-security model
2. Add Struts functionality to our custom tags to work with ActionForms
I would be really greatful for any ideas or suggestions.
Mike
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: extending the Struts custom tags
Posted by Ted Husted <hu...@apache.org>.
The typical approach is to populate existing beans from the ActionForms
(in the Action), since most beans are really not suited for data entry
in a hostile, String-centric HTTP environment.
For output, the existing beans would actually be preferred, since the
ActionForm beans are really tuned for input.
Mike D wrote:
>
> (Ted)
>
> Well, the main features I'm after is the MVC model: i.e. the Controller with
> it's action mappings, the Actions and the Form handling. I really like how
> the ActionForms create a nice request handling and user entry model. The
> validate() method, the custom tags that populate with data if you have the
> form in the Request, etc.
>
> I guess we could extend the controller (if that's the right class) so that it
> would automatically populate our beans rather than the ActionForms... what do
> you think?
>
> How does the populating the ActionForm from the request data after the post
> work?
>
> Many thanks in advance!
>
> Mike
>
> On Sunday 10 February 2002 11:23 am, you wrote:
> > The ActionForms are just JavaBeans, stored in the session or request,
> > like any other.
> >
> > What "Struts functionality" would you need to add to your tags?
> >
> > -- Ted Husted, Husted dot Com, Fairport NY USA.
> > -- Java Web Development with Struts.
> > -- Tel +1 585 737-3463.
> > -- Web http://www.husted.com/struts/
> >
> > Mike D wrote:
> > > we have developed a framework on our project which dynamically writes out
> > > correct tags on the page, including "value" data and properties. For
> > > example:
> > >
> > > <xx:cmp name="person" property="name"> could either write out an anchor
> > > tag or just the value of the person's name property - depending on
> > > permissions set for the current user. The tag property name "person" is
> > > the name of the "person" bean in the request.
> > >
> > > I can't figure out how to couple this with struts ActionForms.
> > >
> > > I can see these 2 possible solutions:
> > >
> > > 1. Extend the Struts custom tags to incorporate our component-security
> > > model 2. Add Struts functionality to our custom tags to work with
> > > ActionForms
> > >
> > > I would be really greatful for any ideas or suggestions.
> > >
> > > Mike
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <ma...@jakarta.apache.org> For additional
> > > commands, e-mail: <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: extending the Struts custom tags
Posted by Mike D <d0...@yahoo.com>.
(Ted)
Well, the main features I'm after is the MVC model: i.e. the Controller with
it's action mappings, the Actions and the Form handling. I really like how
the ActionForms create a nice request handling and user entry model. The
validate() method, the custom tags that populate with data if you have the
form in the Request, etc.
I guess we could extend the controller (if that's the right class) so that it
would automatically populate our beans rather than the ActionForms... what do
you think?
How does the populating the ActionForm from the request data after the post
work?
Many thanks in advance!
Mike
On Sunday 10 February 2002 11:23 am, you wrote:
> The ActionForms are just JavaBeans, stored in the session or request,
> like any other.
>
> What "Struts functionality" would you need to add to your tags?
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Java Web Development with Struts.
> -- Tel +1 585 737-3463.
> -- Web http://www.husted.com/struts/
>
> Mike D wrote:
> > we have developed a framework on our project which dynamically writes out
> > correct tags on the page, including "value" data and properties. For
> > example:
> >
> > <xx:cmp name="person" property="name"> could either write out an anchor
> > tag or just the value of the person's name property - depending on
> > permissions set for the current user. The tag property name "person" is
> > the name of the "person" bean in the request.
> >
> > I can't figure out how to couple this with struts ActionForms.
> >
> > I can see these 2 possible solutions:
> >
> > 1. Extend the Struts custom tags to incorporate our component-security
> > model 2. Add Struts functionality to our custom tags to work with
> > ActionForms
> >
> > I would be really greatful for any ideas or suggestions.
> >
> > Mike
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org> For additional
> > commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: extending the Struts custom tags
Posted by Ted Husted <hu...@apache.org>.
The ActionForms are just JavaBeans, stored in the session or request,
like any other.
What "Struts functionality" would you need to add to your tags?
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/
Mike D wrote:
>
> we have developed a framework on our project which dynamically writes out
> correct tags on the page, including "value" data and properties. For example:
>
> <xx:cmp name="person" property="name"> could either write out an anchor tag
> or just the value of the person's name property - depending on permissions
> set for the current user. The tag property name "person" is the name of the
> "person" bean in the request.
>
> I can't figure out how to couple this with struts ActionForms.
>
> I can see these 2 possible solutions:
>
> 1. Extend the Struts custom tags to incorporate our component-security model
> 2. Add Struts functionality to our custom tags to work with ActionForms
>
> I would be really greatful for any ideas or suggestions.
>
> Mike
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
FormFile questions
Posted by flare <fl...@flare.it>.
I've a classic from where users can insert name, last name etc.. and a photo, everything
is ok but:
1 - the file is uploaded before the form is validated, so may happen one should wait a
couple of minutes before knowing the data inserted is not valid (okok I know that's not a
struts issue ;)
2 - when the actionForm is populated after the error, the file-upload field does not
contain the file name but a cryptic "org.apache.struts.upload.DiskFile@xxxxx xx"
well I know I can fix both problem using Javascript validation (and I probably do so) but I
would like to know how to solve at least the second problem
thanx
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>