Hi Cosma,
Have you tried to set a breakpoint in the getter method of your value?
Sure, the first time I access the managed bean with the ${mybean.value}
syntax the getter method isn't called.
I analysed a litte more: Whenever an JSF tag including a
"#{mybean.something}" is used before the ${...} syntax it works.
It seems that the JSP ELs doesn't find a managed bean when not using a
JSF method before.
Is this right?
Is there are way to init the JSF bean for JSP EL?
What are doing the other folks? How do you access managed bean
property in pure HTML?
Thanks
Chrisi
On 5/19/06, Cosma Colanicchia <[EMAIL PROTECTED]> wrote:
Beware that this syntax should work inside a simple HTML attribute
(such as DIV) only with JSP 2.0 onwards, with previous JSP standards
only JSF tags allows for "#{...}" binding on their attributes.
Have you tried to set a breakpoint in the getter method of your value?
Is it invoked the first time you access the page?
> -----Original Message-----
> From: Chrisi [mailto:[EMAIL PROTECTED]
> Sent: 19 May 2006 11:18
> To: [email protected]
> Subject: Beginner: html-attributes and bean-values
>
>
> Hello,
>
> it's me again with a non magic beginner question;):
>
> We've got some html templates from our web-agency.
> I like to use them in my JSF pages.
>
> In the html template I've got for example the following line:
>
> <DIV class="navigationActive"> lorum .... </DIV>
>
> I need to replace the class-style with a managed bean property and tried
> the following:
>
> 1.) <DIV class="<h:outputText value='#{mybean.value}'/>"> lorum ....
> </DIV>
>
> 2.) <DIV class="${mybean.value}""> lorum .... </DIV>
>
> Nr 1) doesn't work, because the beans value is not placed between the
> attributes double quotes.
>
> Nr 2) seems not to work on the first JSF request. An empty String is
> returned. On following requests this works.
>
> What is the correct and easy way to populated JSF bean values into
> already existing HTML-Code?
>
> Thanks and Greetings
> Chrisi
>
>
> * ** *** ** * ** *** ** * ** *** ** *
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed.
> Any views or opinions presented are solely those of the author, and do not
necessarily represent those of ESB.
> If you have received this email in error please notify the sender.
>
> Although ESB scans e-mail and attachments for viruses, it does not guarantee
> that either are virus-free and accepts no liability for any damage sustained
> as a result of viruses.
>
> * ** *** ** * ** *** ** * ** *** ** *
>
>
--
Thanks and Greetings
Chrisi