On Wed, 2001-11-14 at 21:06, Ted Husted wrote:
> Actually, now that you mention it, there are prefix and suffix
> properties to the ActionMapping, which might help you with this. If you
> specify a prefix and/or suffix in the ActionMapping for the form, the
> population routines prepend or append these when matching the request
> parameters to the form properties. 

Yeah, that's what I was looking at.  In my application of Struts,
ActionServlet isn't used (I'm integrating parts of it into an existing
framework) so I'm not sure I can use the ActionMapping configuration.
I'll have to look into that, or else add support for specifying the
prefix directly on the 'form' tag and its children.

> Without making any changes, you could create form properties as such:
> 
> <input type='text' name='aaaThis' value='<bean:write name="thisForm"
> property="this">'

Cool, it hadn't struck me that this is doable today within Struts
without code changes :-)

> Though, getting the html tags to use the same prefix/suffix specified in
> the ActionMapping seems like a valid idea to me. So the tags would check
> the mapping (in the request) for a prefix or suffix, and then apply it
> to the control name when it is written out. This would allow you to make
> the change without editing Java or JSP code, but just by updating the
> Struts config.

This sounds like something I could implement and contribute back, if
there is interest.  It'd have to be optional behaviour per:

> Of course, this would break any JavaScript references to a control when
> a prefix was added or changed, since the apparent name of the control
> would also change.

Meaning that if you want to tie in JavaScript while using prefixes,
you'd have to ensure the Javascript knew the right prefix.  I guess
there could be a new tag in the HTML taglib to return this, say
'prefix'; would that work?  Of course all this should be mirrored for
suffixes too for consistency.

L.
-- 
zodiac(@)holoweb!net  | "If that's too much initiative for the company
to
ICQ# 78724820         |  handle, I don't want to work for them anyway."



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

Reply via email to