The delete and view are almost the same no?  Maybe you
can use the if statements for these.

For the others - it is really security related.  I
think you should put the logic in the perform() method
and then forward to mapping.readMode() or
mapping.editMode().

Maybe can use the same logic to determine if it is a
delete and then just use the same included jsp as the
view mode (just factor out the similarities).

Using templates or tiles might help as well. (Eg --
the view,delete,edit and add component are really just
extensions of some base component which you can define
with tiles).  The beauty of tiles is the ability to
define all these definitions in a central xml file.

Sandeep
--- "Tom Klaasen (TeleRelay)"
<[EMAIL PROTECTED]> wrote:
> Templates come to mind: one template for viewing,
> one for editing, and
> then you'd only need one select.
> 
> Never worked with templates though, so I'm
> absolutely not sure about
> this. Would love to hear about your solution though,
> as I am going to do
> the same in the near future :-)
> 
> tomK
> 
> > -----Original Message-----
> > From: Scriven, Marcos
> [mailto:[EMAIL PROTECTED]] 
> > Sent: zondag 18 november 2001 15:32
> > To: 'Struts Users Mailing List'
> > Subject: reusing form for readonly
> > 
> > 
> > Hi
> > 
> > I have a form which can be in several different
> modes: VIEW, 
> > ADD, EDIT, and
> > DELETE
> > 
> > If I am in view mode (which I have enumerated as 0
> in an 
> > interface called
> > WebConstants.VIEW), I want the values in my
> <html:text> fields to be
> > readonly.
> > 
> > I can do this on a field by field basis, as such:
> > 
> >         <logic:equal name="productForm"
> property="action" 
> > scope="request"
> > value="<%=String.valueOf(WebConstants.VIEW)%>">
> >             <html:text styleClass="form2"
> property="tradeProduct.ISIN"
> > size="17" maxlength="17" readonly="true"
> > onBlur="javascript:validateName(this);" />
> >         </logic:equal>
> >         <logic:notEqual name="productForm"
> property="action" 
> > scope="request"
> > value="<%=String.valueOf(WebConstants.VIEW)%>">   
>     
> >             <html:text styleClass="form2"
> property="tradeProduct.ISIN"
> > size="17" maxlength="17"
> onBlur="javascript:validateName(this);" />
> >         </logic:notEqual>        
> > 
> > However, is there a shorter/more succinct way? I
> have many 
> > fields within my
> > form, and adding all these equal/notEqual tags
> adds a lot of 
> > lines to my JSP
> > 
> > 
> > Thanks
> > 
> > Marcos
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:struts-user->
> [EMAIL PROTECTED]>
> > For 
> > additional commands, 
> > e-mail:
> <mailto:[EMAIL PROTECTED]>
> > 
> > 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

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

Reply via email to