On our project we overrode the basic struts tags like html:button and html:text and added an editable property. Then, in the ActionForms, we have a method that returns a boolean that the editable property calls. For instance

JSP:
...
<mycompany:button editable="isEditable" />
...

In the ActionForm we have a method called "getIsEditable" and that is where we perform some logic and return true if the button is editable. The tag simply doesn't display the button if it is not. For text fields, we make them either a label or a text input depending on the editable property.

We do only UI level logic like being authorized to have access to certain functionality or "is something readonly based on state?" - business logic is left to the business side which may be called if necessary.

Don't let overriding tags deter you it is actually quite easy.

Cheers,
Scott

Navaketan Mohanty wrote:

Hi all,

We are using Struts for our Web Application. We have
to do Hide and Show of fields on a JSP pages depending
on certain conditions and business requirements. We do
not want to put the logic of managing the hide and
show in the JSP. We are thinking about doing it in the
Action class. Action class will do a validation and
will send to the JSP, through the Http Session, the
information of Hide and Show. The JSP will use this
info to render itself. Also we want this to be
configuration driven, if possible. Many of you must
have this kind of work before. Can you please share
your experience? Can Objective HTML and Struts be used
together for this?


Any help and suggestion is most welcome.

Thanks,
Navaketan


__________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree

_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org







_______________________________________________ Juglist mailing list [EMAIL PROTECTED] http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to