Alun,
I have the same issue, but currently Struts does not support this feature,
and I don't know if they will. I might get blasted for the next few
statements, but I have seen some people extend the the struts custom tag to
do the same thing you are indicating. I am not saying it is the best way to
go.

For example you have the Struts class called
org.apache.struts.taglib.html.TextTag. I have seen an implmentation where
the a developer created new tag library called MyTextTag where it extended
the the Strut org.apache.struts.taglib.html.TextTag class, and added a
boolean parameter called editable. If this editable parameter was set to
true the the doStartTag() method  would call super.doStartTag(), and if it
was false it would print the value.

I don't know if this is the best way togo, but it is one option for you.

Chris Gastin


----- Original Message ----- 
From: "Coppack Alun" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 30, 2003 9:05 PM
Subject: Same JSP for view and edit


I want to use a single JSP for view and edit functionality.

I have no problems using the one page for edit and add functionality (and a
single action as well) as these both require input fields. The issue with
view is that I don't want input fields, I only want labels/text but I want
to display the same information that would be displayed on an edit page.

It seems that I have a lot of duplication having one jsp with bean:write
fields for the view and another with the same fields but inside html:form
and html:input tags for the edit functionality.

I thought maybe it would be possible using a custom tag library that can
dynamically modify the jsp based on a request parameter.

Any other thoughts?

Thanks,

Alun




************************************************************************
The information in this e-mail together with any attachments is
intended only for the person or entity to which it is addressed
and may contain confidential and/or privileged material.
Any form of review, disclosure, modification, distribution
and/or publication of this e-mail message is prohibited.
If you have received this message in error, you are asked to
inform the sender as quickly as possible and delete this message
and any copies of this message from your computer and/or your
computer system network.
************************************************************************


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


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

Reply via email to