You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alf Konrath <al...@oracle.com> on 2001/09/13 14:58:26 UTC

shown variable value in -input

hi struts-users,

perhaps someone can help me? :-)

i have a problem with the <html:text>-tag. i dont surely understand what
i have to put in the value-parameter. it is stated that i can use
runtime-expressions, but i definitely dont get it running.

my tag looks something like:

<html:text name="nameOfJSPBean"
           property="nameOfPropertyOfJSPBean"
           value="" >

i just want to get a text-input, which is filled with the same
value of my JSPBean, in which the input of the user will be pasted upon
population.

so i tried things like:
(Yeah, i really know, that this can't work  ;)  )

<html:text name="nameOfJSPBean"
           property="nameOfPropertyOfJSPBean"
           value="<%= nameOfJSPBean.getNameOfPropertyOfJSPBean() %>" >

and the runtime expression thing, explained in the BeanTagDeveloperGuide
like:

<html:text name="nameOfJSPBean"
           property="nameOfPropertyOfJSPBean"
           value="nameOfPropertyOfJSPBean" >

but also this doesn't work ... the String "nameOfPropertyOfJSPBean" is
just interpreted as String.

can anyone give me a hint, what i am doing wrong and how to solve it?
thanx for your help in advance!

best regards,
alf

ps: i use VA4J 3.5.3. is it perhaps a bug of that ide???

Re: shown variable value in -input

Posted by Luis Olivares <ol...@infosphere.com>.
Aren't you missing the '/' at the end of the Text Tag?

If your tag is like this:

 <html:text name="nameOfJSPBean"
            property="nameOfPropertyOfJSPBean"
            value="" >

just add an '/' at the end of the tag:

 <html:text name="nameOfJSPBean"
            property="nameOfPropertyOfJSPBean"
            value="" />

Struts tags always needs to be enclosed (Its not like HTML in that aspect).

Regards.

                       Luis Olivares.
           luis.olivares@infosphere.com
   --------------------------------------------------------------
  "Intelligence is the ability to avoid doing
       work, yet getting the work done"
                  --Linus Torvalds--

----- Original Message ----- 
From: "Alf Konrath" <al...@oracle.com>
To: <st...@jakarta.apache.org>
Sent: Thursday, September 13, 2001 7:58 AM
Subject: shown variable value in <html:text>-input


> hi struts-users,
> 
> perhaps someone can help me? :-)
> 
> i have a problem with the <html:text>-tag. i dont surely understand what
> i have to put in the value-parameter. it is stated that i can use
> runtime-expressions, but i definitely dont get it running.
> 
> my tag looks something like:
> 
> <html:text name="nameOfJSPBean"
>            property="nameOfPropertyOfJSPBean"
>            value="" >
> 
> i just want to get a text-input, which is filled with the same
> value of my JSPBean, in which the input of the user will be pasted upon
> population.
> 
> so i tried things like:
> (Yeah, i really know, that this can't work  ;)  )
> 
> <html:text name="nameOfJSPBean"
>            property="nameOfPropertyOfJSPBean"
>            value="<%= nameOfJSPBean.getNameOfPropertyOfJSPBean() %>" >
> 
> and the runtime expression thing, explained in the BeanTagDeveloperGuide
> like:
> 
> <html:text name="nameOfJSPBean"
>            property="nameOfPropertyOfJSPBean"
>            value="nameOfPropertyOfJSPBean" >
> 
> but also this doesn't work ... the String "nameOfPropertyOfJSPBean" is
> just interpreted as String.
> 
> can anyone give me a hint, what i am doing wrong and how to solve it?
> thanx for your help in advance!
> 
> best regards,
> alf
> 
> ps: i use VA4J 3.5.3. is it perhaps a bug of that ide???
> 
> 


Re: shown variable value in -input

Posted by Alf Konrath <al...@oracle.com>.
Hi Gollo,

now after a day of search i have found out, why the bean value wasn't
displayed.
you are right, the value would be shown ... IF the database is there! ;)
another teamdeveloper has switched the database without giving me a
hint.

sorry all for not checking that further.

thanx alf




Sean Gollschewsky wrote:
> 
> Hi Alf,
> 
> Yes, removing the value attribute should do exactly as you want.  From
> the documentation
> 
> value: Value to which this field should be initialized. [Use the
> corresponding bean property value] [RT Expr]
> 
> The default value of value (this is confusing :-)) is described in the
> square brackets.  So if you don't specify the value attribute, the
> default will be taken, which is to use the value from the bean.
> 
> Gollo.
>

RE: shown variable value in -input

Posted by Sean Gollschewsky <se...@ispw.com>.
Hi Alf,

Yes, removing the value attribute should do exactly as you want.  From
the documentation

value: Value to which this field should be initialized. [Use the
corresponding bean property value] [RT Expr]  

The default value of value (this is confusing :-)) is described in the
square brackets.  So if you don't specify the value attribute, the
default will be taken, which is to use the value from the bean.

Gollo.

 -----Original Message-----
From: Alf Konrath [mailto:alf.konrath@oracle.com] 
Sent: Thursday, 13 September 2001 2:38 PM
To: struts-user@jakarta.apache.org
Subject: Re: shown variable value in <html:text>-input

Hi Gollo,

thanks for your help, but the population to the bean isn't my problem,
that works well. 
my problem is displaying the value of that JSPBeanProperty, that was
entered already or read from a database.

in 'normal' jsp-development i would use:

<input type="text" name="propertyname" value="<%= bean.getPropertyname()
%>">

and for that bean.getPropertyname()-call i search the solution with the
html:text-tag

Do you have another idea???

Regards,
alf



Sean Gollschewsky wrote:
> 
> Try removing the value attribute altogether, eg
> 
> <html:text name="nameOfJSPBean"
>                            property="nameOfPropertyOfJSPBean">
> 
> That should populate the text field with the value of the field in
> nameOfJSPBean.
> 
> Cheers,
> 
> Gollo.
> ______
>


Re: shown variable value in -input

Posted by Alf Konrath <al...@oracle.com>.
Hi Gollo,

thanks for your help, but the population to the bean isn't my problem,
that works well. 
my problem is displaying the value of that JSPBeanProperty, that was
entered already or read from a database.

in 'normal' jsp-development i would use:

<input type="text" name="propertyname" value="<%= bean.getPropertyname()
%>">

and for that bean.getPropertyname()-call i search the solution with the
html:text-tag

Do you have another idea???

Regards,
alf



Sean Gollschewsky wrote:
> 
> Try removing the value attribute altogether, eg
> 
> <html:text name="nameOfJSPBean"
>                            property="nameOfPropertyOfJSPBean">
> 
> That should populate the text field with the value of the field in
> nameOfJSPBean.
> 
> Cheers,
> 
> Gollo.
> ______
>

RE: shown variable value in -input

Posted by Sean Gollschewsky <se...@ispw.com>.
Try removing the value attribute altogether, eg

<html:text name="nameOfJSPBean" 
		           property="nameOfPropertyOfJSPBean">

That should populate the text field with the value of the field in
nameOfJSPBean.

Cheers,

Gollo.
______



 

-----Original Message-----
From: Alf Konrath [mailto:alf.konrath@oracle.com] 
Sent: Thursday, 13 September 2001 1:58 PM
To: struts-user@jakarta.apache.org
Subject: shown variable value in <html:text>-input

hi struts-users,

perhaps someone can help me? :-)

i have a problem with the <html:text>-tag. i dont surely understand what
i have to put in the value-parameter. it is stated that i can use
runtime-expressions, but i definitely dont get it running.

my tag looks something like:

<html:text name="nameOfJSPBean"
           property="nameOfPropertyOfJSPBean"
           value="" >

i just want to get a text-input, which is filled with the same
value of my JSPBean, in which the input of the user will be pasted upon
population.

so i tried things like:
(Yeah, i really know, that this can't work  ;)  )

<html:text name="nameOfJSPBean"
           property="nameOfPropertyOfJSPBean"
           value="<%= nameOfJSPBean.getNameOfPropertyOfJSPBean() %>" >

and the runtime expression thing, explained in the BeanTagDeveloperGuide
like:

<html:text name="nameOfJSPBean"
           property="nameOfPropertyOfJSPBean"
           value="nameOfPropertyOfJSPBean" >

but also this doesn't work ... the String "nameOfPropertyOfJSPBean" is
just interpreted as String.

can anyone give me a hint, what i am doing wrong and how to solve it?
thanx for your help in advance!

best regards,
alf

ps: i use VA4J 3.5.3. is it perhaps a bug of that ide???