You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Hans Reip <sp...@googlemail.com> on 2007/03/15 16:09:58 UTC

Usage of

Tag with JSF

Hi,

I'm doing my first steps with JSF and myFaces and I hav a question regarding
html-tags and JSF.

I want to output a resource bundle key inside a <h1> html element. So I did
following:
<h1><h:outputText value="#{msg.inputname_header}"/></h1>

What happens is, that the message from the resource bundle is printed out
and after this the empty <h1>.
No error is returned, so I think it is an basical understanding problem.

I saw, that there is a <t:div> tag in the tomahawk tld but no <t:h1> tag.
What do I do wrong? Isn't it possible to use html tags together with JSF?

Thanks in advance
Regards
Hans

-- 
View this message in context: http://www.nabble.com/Usage-of-%3Ch1%3E-Tag-with-JSF-tf3408888.html#a9496546
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Usage of

Tag with JSF

Posted by Simon Kitching <si...@rhe.co.nz>.
Yep. JSF1.1+JSP has problems mixing plain text and jsf tags.

Unless you really need an <h1> tag for some reason, why not just use css 
styles?
   <h:outputText styleClass="h1" value="foo"/>

Define css style "h1" to be whatever you want, eg
.h1 {
   color: red;
   font-size: large;
}

Of course sometimes an <h1> tag really is a good idea. In particular, 
screen-readers for the blind etc work better with meaningful markup.

Regards,

Simon

Marcel Stonitsch wrote:
> Try <t:htmlTag value="h1"><h:outputText value="#{msg['bla.bla']}" 
> /></t:htmlTag>
> 
> 
> Hans Reip schrieb:
>> Hi,
>>
>> I'm doing my first steps with JSF and myFaces and I hav a question 
>> regarding
>> html-tags and JSF.
>>
>> I want to output a resource bundle key inside a <h1> html element. So 
>> I did
>> following:
>> <h1><h:outputText value="#{msg.inputname_header}"/></h1>
>>
>> What happens is, that the message from the resource bundle is printed out
>> and after this the empty <h1>.
>> No error is returned, so I think it is an basical understanding problem.
>>
>> I saw, that there is a <t:div> tag in the tomahawk tld but no <t:h1> tag.
>> What do I do wrong? Isn't it possible to use html tags together with JSF?
>>
>> Thanks in advance
>> Regards
>> Hans
>>
>>   
> 


Re: Usage of

Tag with JSF

Posted by Marcel Stonitsch <st...@klute-thiemann.de>.
Try <t:htmlTag value="h1"><h:outputText value="#{msg['bla.bla']}" 
/></t:htmlTag>


Hans Reip schrieb:
> Hi,
>
> I'm doing my first steps with JSF and myFaces and I hav a question regarding
> html-tags and JSF.
>
> I want to output a resource bundle key inside a <h1> html element. So I did
> following:
> <h1><h:outputText value="#{msg.inputname_header}"/></h1>
>
> What happens is, that the message from the resource bundle is printed out
> and after this the empty <h1>.
> No error is returned, so I think it is an basical understanding problem.
>
> I saw, that there is a <t:div> tag in the tomahawk tld but no <t:h1> tag.
> What do I do wrong? Isn't it possible to use html tags together with JSF?
>
> Thanks in advance
> Regards
> Hans
>
>   


Re: Usage of

Tag with JSF

Posted by Werner Punz <we...@gmail.com>.
Hans Reip schrieb:
> Hi @ all,
> 
> thanks for your help. I must say that this situation is a little bit
> disappointing.
> In my opinion it should be possible to use HTML Tags in the JSP.
> 
this is a limitation due to the fact that jsp and jsf use different
stages of rendering, this issue is resolved in jsf 1.2
and also in facelets.

the main problem is, that jsp uses the last stage of the jsf processing
stages while jsf does a lot of things upfront this is inherently
problematic in c:foreach etc.. constructs.

> At least it is possible to use the <t:html> tag but now I need to check if
> it is possible to pass attributes like "style" or "class" to this tag.
> 
actually there are other options as well, one of the exadel guys
has written a html/jsf taglib it is linked somehwhere from jsfcentral,
it blends in really well with the rest of the taglibs and also
a lot of people have moved over to facelets and dropped jsp altogether
for a lot of reasons, the html / jsf mixin problem being one of them,


Re: Usage of

Tag with JSF

Posted by Hans Reip <sp...@googlemail.com>.
Hi @ all,

thanks for your help. I must say that this situation is a little bit
disappointing.
In my opinion it should be possible to use HTML Tags in the JSP.

At least it is possible to use the <t:html> tag but now I need to check if
it is possible to pass attributes like "style" or "class" to this tag.

Thanks.
Regards

hans
-- 
View this message in context: http://www.nabble.com/Usage-of-%3Ch1%3E-Tag-with-JSF-tf3408888.html#a9509139
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Usage of

Tag with JSF

Posted by Volker Weber <v....@inexso.de>.
Mike,

you are right, if you already have tomahawk in the app, this was just
a solution in plain jsf.

Regards,
  Volker

2007/3/15, Mike Kienenberger <mk...@gmail.com>:
> Volker,
>
> t:htmlTag is cleaner than h:outputText, but both solve it using the
> same technique -- make the text into a componet.
>
> On 3/15/07, Volker Weber <v....@inexso.de> wrote:
> > A third solution, which i would prefer about the f:verbatim:
> >
> > <h:outputText escape="false" value="<H1>"/>
> >   <h:outputText value="#{msg['bla.bla']}"/>
> > <h:outputText escape="false" value="</H1>"/>
> >
> > reason: content of verbatim tags dissapears after rerender in case of
> > validation/conversion errors.
> >
> > Regards,
> >   Volker
> >
> > 2007/3/15, Marcel Stonitsch <st...@klute-thiemann.de>:
> > > Another possibility I forgot in my previous mail: Put your html-code
> > > into <f:verbatim>-tags.
> > >
> > > Mixing html-tags and jsf-tags can cause several problems.
> > >
> > > Hans Reip schrieb:
> > > > Hi,
> > > >
> > > > I'm doing my first steps with JSF and myFaces and I hav a question regarding
> > > > html-tags and JSF.
> > > >
> > > > I want to output a resource bundle key inside a <h1> html element. So I did
> > > > following:
> > > > <h1><h:outputText value="#{msg.inputname_header}"/></h1>
> > > >
> > > > What happens is, that the message from the resource bundle is printed out
> > > > and after this the empty <h1>.
> > > > No error is returned, so I think it is an basical understanding problem.
> > > >
> > > > I saw, that there is a <t:div> tag in the tomahawk tld but no <t:h1> tag.
> > > > What do I do wrong? Isn't it possible to use html tags together with JSF?
> > > >
> > > > Thanks in advance
> > > > Regards
> > > > Hans
> > > >
> > > >
> > >
> > >
> >
>

Re: Usage of

Tag with JSF

Posted by Mike Kienenberger <mk...@gmail.com>.
Volker,

t:htmlTag is cleaner than h:outputText, but both solve it using the
same technique -- make the text into a componet.

On 3/15/07, Volker Weber <v....@inexso.de> wrote:
> A third solution, which i would prefer about the f:verbatim:
>
> <h:outputText escape="false" value="<H1>"/>
>   <h:outputText value="#{msg['bla.bla']}"/>
> <h:outputText escape="false" value="</H1>"/>
>
> reason: content of verbatim tags dissapears after rerender in case of
> validation/conversion errors.
>
> Regards,
>   Volker
>
> 2007/3/15, Marcel Stonitsch <st...@klute-thiemann.de>:
> > Another possibility I forgot in my previous mail: Put your html-code
> > into <f:verbatim>-tags.
> >
> > Mixing html-tags and jsf-tags can cause several problems.
> >
> > Hans Reip schrieb:
> > > Hi,
> > >
> > > I'm doing my first steps with JSF and myFaces and I hav a question regarding
> > > html-tags and JSF.
> > >
> > > I want to output a resource bundle key inside a <h1> html element. So I did
> > > following:
> > > <h1><h:outputText value="#{msg.inputname_header}"/></h1>
> > >
> > > What happens is, that the message from the resource bundle is printed out
> > > and after this the empty <h1>.
> > > No error is returned, so I think it is an basical understanding problem.
> > >
> > > I saw, that there is a <t:div> tag in the tomahawk tld but no <t:h1> tag.
> > > What do I do wrong? Isn't it possible to use html tags together with JSF?
> > >
> > > Thanks in advance
> > > Regards
> > > Hans
> > >
> > >
> >
> >
>

Re: Usage of

Tag with JSF

Posted by Volker Weber <v....@inexso.de>.
I can't currentyl reproduce this, but i'm sure i run into this last year.
Environment was jsp, sunRI and tobago.

regards,
  Volker

2007/3/15, Jeff Bischoff <jb...@klkurz.com>:
> Volker,
>
> In what environment does that occur? I have never "lost" the contents of
> my verbatim tags. I no longer use verbatim, now that I have Facelets,
> but I used them extensively for quite a while.
>
> I am aware that contents of verbatim are marked "transient", and thus do
> not participate in state-saving... but as for actually having the markup
> vanish from the page?
>
> Regards,
>
> Jeff Bischoff
> Kenneth L Kurz & Associates, Inc.
>
> Volker Weber wrote:
> > A third solution, which i would prefer about the f:verbatim:
> >
> > <h:outputText escape="false" value="<H1>"/>
> >  <h:outputText value="#{msg['bla.bla']}"/>
> > <h:outputText escape="false" value="</H1>"/>
> >
> > reason: content of verbatim tags dissapears after rerender in case of
> > validation/conversion errors.
> >
> > Regards,
> >  Volker
> >
> > 2007/3/15, Marcel Stonitsch <st...@klute-thiemann.de>:
> >> Another possibility I forgot in my previous mail: Put your html-code
> >> into <f:verbatim>-tags.
> >>
> >> Mixing html-tags and jsf-tags can cause several problems.
> >>
> >> Hans Reip schrieb:
> >> > Hi,
> >> >
> >> > I'm doing my first steps with JSF and myFaces and I hav a question
> >> regarding
> >> > html-tags and JSF.
> >> >
> >> > I want to output a resource bundle key inside a <h1> html element.
> >> So I did
> >> > following:
> >> > <h1><h:outputText value="#{msg.inputname_header}"/></h1>
> >> >
> >> > What happens is, that the message from the resource bundle is
> >> printed out
> >> > and after this the empty <h1>.
> >> > No error is returned, so I think it is an basical understanding
> >> problem.
> >> >
> >> > I saw, that there is a <t:div> tag in the tomahawk tld but no <t:h1>
> >> tag.
> >> > What do I do wrong? Isn't it possible to use html tags together with
> >> JSF?
> >> >
> >> > Thanks in advance
> >> > Regards
> >> > Hans
> >> >
> >> >
> >>
> >>
> >
> >
> >
>
>
>
>

Re: Usage of

Tag with JSF

Posted by Jeff Bischoff <jb...@klkurz.com>.
Volker,

In what environment does that occur? I have never "lost" the contents of 
my verbatim tags. I no longer use verbatim, now that I have Facelets, 
but I used them extensively for quite a while.

I am aware that contents of verbatim are marked "transient", and thus do 
not participate in state-saving... but as for actually having the markup 
vanish from the page?

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

Volker Weber wrote:
> A third solution, which i would prefer about the f:verbatim:
> 
> <h:outputText escape="false" value="<H1>"/>
>  <h:outputText value="#{msg['bla.bla']}"/>
> <h:outputText escape="false" value="</H1>"/>
> 
> reason: content of verbatim tags dissapears after rerender in case of
> validation/conversion errors.
> 
> Regards,
>  Volker
> 
> 2007/3/15, Marcel Stonitsch <st...@klute-thiemann.de>:
>> Another possibility I forgot in my previous mail: Put your html-code
>> into <f:verbatim>-tags.
>>
>> Mixing html-tags and jsf-tags can cause several problems.
>>
>> Hans Reip schrieb:
>> > Hi,
>> >
>> > I'm doing my first steps with JSF and myFaces and I hav a question 
>> regarding
>> > html-tags and JSF.
>> >
>> > I want to output a resource bundle key inside a <h1> html element. 
>> So I did
>> > following:
>> > <h1><h:outputText value="#{msg.inputname_header}"/></h1>
>> >
>> > What happens is, that the message from the resource bundle is 
>> printed out
>> > and after this the empty <h1>.
>> > No error is returned, so I think it is an basical understanding 
>> problem.
>> >
>> > I saw, that there is a <t:div> tag in the tomahawk tld but no <t:h1> 
>> tag.
>> > What do I do wrong? Isn't it possible to use html tags together with 
>> JSF?
>> >
>> > Thanks in advance
>> > Regards
>> > Hans
>> >
>> >
>>
>>
> 
> 
> 




Re: Usage of

Tag with JSF

Posted by Volker Weber <v....@inexso.de>.
A third solution, which i would prefer about the f:verbatim:

<h:outputText escape="false" value="<H1>"/>
  <h:outputText value="#{msg['bla.bla']}"/>
<h:outputText escape="false" value="</H1>"/>

reason: content of verbatim tags dissapears after rerender in case of
validation/conversion errors.

Regards,
  Volker

2007/3/15, Marcel Stonitsch <st...@klute-thiemann.de>:
> Another possibility I forgot in my previous mail: Put your html-code
> into <f:verbatim>-tags.
>
> Mixing html-tags and jsf-tags can cause several problems.
>
> Hans Reip schrieb:
> > Hi,
> >
> > I'm doing my first steps with JSF and myFaces and I hav a question regarding
> > html-tags and JSF.
> >
> > I want to output a resource bundle key inside a <h1> html element. So I did
> > following:
> > <h1><h:outputText value="#{msg.inputname_header}"/></h1>
> >
> > What happens is, that the message from the resource bundle is printed out
> > and after this the empty <h1>.
> > No error is returned, so I think it is an basical understanding problem.
> >
> > I saw, that there is a <t:div> tag in the tomahawk tld but no <t:h1> tag.
> > What do I do wrong? Isn't it possible to use html tags together with JSF?
> >
> > Thanks in advance
> > Regards
> > Hans
> >
> >
>
>

Re: Usage of

Tag with JSF

Posted by Grant Smith <wo...@gmail.com>.
On 3/15/07, Marcel Stonitsch <st...@klute-thiemann.de> wrote:
>
> Another possibility I forgot in my previous mail: Put your html-code
> into <f:verbatim>-tags.
>
> Mixing html-tags and jsf-tags can cause several problems.



Unless you use Facelets, which is recommended.

Hans Reip schrieb:
> > Hi,
> >
> > I'm doing my first steps with JSF and myFaces and I hav a question
> regarding
> > html-tags and JSF.
> >
> > I want to output a resource bundle key inside a <h1> html element. So I
> did
> > following:
> > <h1><h:outputText value="#{msg.inputname_header}"/></h1>
> >
> > What happens is, that the message from the resource bundle is printed
> out
> > and after this the empty <h1>.
> > No error is returned, so I think it is an basical understanding problem.
> >
> > I saw, that there is a <t:div> tag in the tomahawk tld but no <t:h1>
> tag.
> > What do I do wrong? Isn't it possible to use html tags together with
> JSF?
> >
> > Thanks in advance
> > Regards
> > Hans
> >
> >
>
>


-- 
Grant Smith

Re: Usage of

Tag with JSF

Posted by Marcel Stonitsch <st...@klute-thiemann.de>.
Another possibility I forgot in my previous mail: Put your html-code 
into <f:verbatim>-tags.

Mixing html-tags and jsf-tags can cause several problems.

Hans Reip schrieb:
> Hi,
>
> I'm doing my first steps with JSF and myFaces and I hav a question regarding
> html-tags and JSF.
>
> I want to output a resource bundle key inside a <h1> html element. So I did
> following:
> <h1><h:outputText value="#{msg.inputname_header}"/></h1>
>
> What happens is, that the message from the resource bundle is printed out
> and after this the empty <h1>.
> No error is returned, so I think it is an basical understanding problem.
>
> I saw, that there is a <t:div> tag in the tomahawk tld but no <t:h1> tag.
> What do I do wrong? Isn't it possible to use html tags together with JSF?
>
> Thanks in advance
> Regards
> Hans
>
>