Thanks to all of you. I'll try your suggestions and let you know.
Nadia

-----Original Message-----
From: Fogleson, Allen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 29, 2004 3:47 PM
To: 'Struts Users Mailing List'
Subject: RE: <bean:write> within <html:text>, how to use?


Optionally,

What I have often done with DTO's is populate the action form from the DTO
and place the action form in the appropriate scope for use by the page.
Assuming that almost everything is a call to an action you can do this in
the action class just prior to forwarding to the view. It gets rid of the
<bean:write...> calls. 

I personally think this is the cleanest way to do this. 

Al
 



-----Original Message-----
From: David G. Friedman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 29, 2004 3:35 PM
To: Struts Users Mailing List
Subject: RE: <bean:write> within <html:text>, how to use?

Nadia,

Since you're talking DTO and not an input form bean, I recommend putting
your myBeanName object in the "request" scope using the method
request.saveAttribute() to store it.  You should then be able to access it
using html:text and the name="myBeanName" parameter a bit like this:

<html:text name="myBeanName" property="id" />

Without the name="myBeanName", the html:text defaults to using the default
bean for the Action.  Since you already have one, that is why I suggested
putting the DTO in the request scope.

Regards,
David

-----Original Message-----
From: Nadia Kunkov [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 29, 2004 3:26 PM
To: Struts Users Mailing List
Subject: RE: <bean:write> within <html:text>, how to use?


OK. I obviously don't know enough to use the tags properly even though I've
been playing with struts for a week or two.  My biggest problems are with
the presentation.
The bean myBeanName is the DTO object and not an action form so it's not
specified in the struts-config.xml.  The action form for this screen is
configured in struts-config.xml.
Now what is the right way to do things?  Can I fill out my action form with
data? What do I need to do in my jsp to display the data then?  Or I need to
declare my DTO bean in struts-config?
I apologize if the questions are absolutely dumb :)
NK

-----Original Message-----
From: Ricardo Andres Quintero [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 29, 2004 2:14 PM
To: Struts Users Mailing List
Subject: Re: <bean:write> within <html:text>, how to use?


Hello Nadia
I dont know why you use
<html:text
 name="somename" value= ' <bean:write name="myBeanName"
 property="id"/> ' />
instead of use
<html:text
 name="myBeanName" property="id" />
did u configure myBeanName in the struts-congig.xml?
does the action of the html:form use the bean-form myBeanName?

On Wed, 29 Sep 2004 15:03:02 -0400, Nadia Kunkov wrote
> Hi, newbie question again.
> I'm trying to use <bean:write> within <html:text> tag.
>
> Here is how I use it with just plain HTML and it works:
> <input type=text name="somename" value= ' <bean:write
> name="myBeanName" property="id"/> ' > or <input type=hidden
> name="somename" value= ' <bean:write name="myBeanName"
> property="id"/> ' myBeanName is a bean that was put in a session
> with the data from the database.
>
> Instead of the <input type=text ...> etc.  I'd like to use
> <html:text....>  or <html:hidden....> I tried <html:text
> name="somename" value= ' <bean:write name="myBeanName"
> property="id"/> ' /> but that's not right.  Could you help me with this?
>
> Also, is having the bean in a session or request with data from the
> database and then using bean:write, only way of displaying the data
> on a page?
> There is BeanUtils method to populate DTO with the data
> from an action form,

  u can use common-bean but i think is better to loab the DTO property per
  property.

> can I somehow populate an action form from a
> bean instead of using bean:write in my jsp?

I dont understand this.
>
> Thanks for your help
> NK
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


--
Ricardo Andrés Quintero R.
Ubiquando Ltda.


---------------------------------------------------------------------
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]


---------------------------------------------------------------------
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]


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

Reply via email to