struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <ahardy.str...@cyberspaceroad.com>
Subject Re: Outputting form:text value as "normal" text in the .jsp
Date Thu, 10 Jul 2003 08:38:36 GMT
I would not put the text to display into the form. Just put it straight 
in the request scope when you obtain it, or in both places if needs be. 
Or alternatively, output it as a read-only text field with CSS styles 
that make the field box invisible.

Adam

Linus Nikander wrote:
> Is there a way to output the value of an attribute contained in a Form as
> "normal" text on the displaying .jsp page ? The following code illustrates
> what I'm trying to do.
> 
> <html:form action="/saveRegistrationHandlerSettings">
>     <html:checkbox property="isRegistrationAllowed"/>
>     <bean:write name="registrationHandlerForm"
> property="isRegistrationAllowed" />
> </html:form>
> 
> isRegistrationAllowed is a checkbox property. the "<html:checkbox
> property="isRegistrationAllowed"/>" works fine and displays the set value.
> "<bean:write name="registrationHandlerForm" property="isRegistrationAllowed"
> />" also works fine and renders "true" or "false" to the screen.
> 
> Essentially that is exactly what I want to do, BUT when using the
> <bean:write ..> tag i have to specify which bean the property is to be
> fetched from, thus I make the .jsp dependant on the fact that
> registrationHandlerForm is the name of the bean in the request/session. The
> form on the other hand knows the name of the bean because of the
> struts-config.xml. Is there another way to output the text without
> explicitly naming the bean in the .jsp ?
> 
> //Linus Nikander - linus@nikander.net
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message