You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Burghard Britzke <bu...@charmides.in-berlin.de> on 2007/07/23 12:52:57 UTC

[Trinidad] when it decides to render xhtml and when to render html 4.01?

hi,
sometimes the <tr:document> decides to render xhtml and sometimes  
html4.01. how to control it?


Re: [Trinidad] when it decides to render xhtml and when to render html 4.01?

Posted by Burghard Britzke <bu...@charmides.in-berlin.de>.
yes, I missed it.

another thing is, that the rendered xhtml is not w3c conform. this  
may be the reason why I noticed a missfunction of the paging and  
sorting controls of the <tr:table> (see  [Trinidad] sorting table,  
table range navigation...)

if I let it render html 4.01 the table controls behave as expected
if I let it render xhtml the table controls shows no reaction on a click

the w3c-html validator found the following errors:

> required attribute "type" not specified" for the <script> tags

and

> value of attribute "method" cannot be "POST"; must be one of "get",  
> "post"' for the <form> tag



Am 26.07.2007 um 01:05 schrieb Adam Winer:

> In Facelets, use contentType on f:view.
> In JSP, use the contentType directive.
>
> -- Adam
>
>
> On 7/25/07, Matthias Wessendorf <ma...@apache.org> wrote:
>> https://facelets.dev.java.net/source/browse/facelets/src/java/com/ 
>> sun/facelets/tag/jsf/core/ViewHandler.java?rev=1.4&view=markup
>>
>>
>> public ViewHandler(TagConfig config) {
>>         super(config);
>> ...
>>         this.encoding = this.getAttribute("encoding");
>> ...
>>     }
>> ...
>> if (this.contentType != null) {
>>                 String v = this.contentType.getValue(ctx);
>>
>> ctx.getFacesContext().getExternalContext().getRequestMap().put 
>> ("facelets.ContentType",
>> v);
>>
>>             }
>>
>> On 7/25/07, Burghard Britzke <bu...@charmides.in-berlin.de> wrote:
>> >  but it is true:
>> >
>> >
>> > <f:view
>> >    xmlns:f="http://java.sun.com/jsf/core"
>> >    xmlns:tr="http://myfaces.apache.org/trinidad">
>> >    <tr:document>
>> >    </tr:document>
>> > </f:view>
>> >
>> > renders as
>> >
>> >
>> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ...
>> >
>> > and
>> >
>> >
>> > <f:view contentType="text/xml"
>> >    xmlns:f="http://java.sun.com/jsf/core"
>> >    xmlns:tr="http://myfaces.apache.org/trinidad">
>> >    <tr:document>
>> >    </tr:document>
>> > </f:view>
>> >
>> > renders as
>> >
>> >
>> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...
>> >
>> >
>> > Am 25.07.2007 um 10:00 schrieb Burghard Britzke:
>> >
>> > <f.view> does not have an attribute contentType. for the RI.  
>> does it have
>> > such an attribute in MyFaces?
>> >
>> > Am 23.07.2007 um 23:23 schrieb noah:
>> >
>> >
>> > I can confirm that it does.
>> > <f:view contentType="text/html"> seems to be a necessity if you  
>> want
>> > Dojo to work.
>> >
>> > On 7/23/07, Adam Winer <aw...@gmail.com> wrote:
>> > In Facelets, setting contentType on f:view should do
>> > the trick, but I don't know for sure.
>> > > >>
>> >
>> > ...
>> >
>> >
>> >
>> > > >> On 7/23/07, Burghard Britzke <bu...@charmides.in-berlin.de>  
>> wrote:
>> > > >> > hi,
>> > > >> > sometimes the <tr:document> decides to render xhtml and  
>> sometimes
>> > > >> > html4.01. how to control it?
>>
>>
>>
>> --
>> Matthias Wessendorf
>>
>> further stuff:
>> blog: http://matthiaswessendorf.wordpress.com/
>> mail: matzew-at-apache-dot-org
>>


Re: [Trinidad] when it decides to render xhtml and when to render html 4.01?

Posted by Adam Winer <aw...@gmail.com>.
In Facelets, use contentType on f:view.
In JSP, use the contentType directive.

-- Adam


On 7/25/07, Matthias Wessendorf <ma...@apache.org> wrote:
> https://facelets.dev.java.net/source/browse/facelets/src/java/com/sun/facelets/tag/jsf/core/ViewHandler.java?rev=1.4&view=markup
>
>
> public ViewHandler(TagConfig config) {
>         super(config);
> ...
>         this.encoding = this.getAttribute("encoding");
> ...
>     }
> ...
> if (this.contentType != null) {
>                 String v = this.contentType.getValue(ctx);
>
> ctx.getFacesContext().getExternalContext().getRequestMap().put("facelets.ContentType",
> v);
>
>             }
>
> On 7/25/07, Burghard Britzke <bu...@charmides.in-berlin.de> wrote:
> >  but it is true:
> >
> >
> > <f:view
> >    xmlns:f="http://java.sun.com/jsf/core"
> >    xmlns:tr="http://myfaces.apache.org/trinidad">
> >    <tr:document>
> >    </tr:document>
> > </f:view>
> >
> > renders as
> >
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ...
> >
> > and
> >
> >
> > <f:view contentType="text/xml"
> >    xmlns:f="http://java.sun.com/jsf/core"
> >    xmlns:tr="http://myfaces.apache.org/trinidad">
> >    <tr:document>
> >    </tr:document>
> > </f:view>
> >
> > renders as
> >
> >
> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...
> >
> >
> > Am 25.07.2007 um 10:00 schrieb Burghard Britzke:
> >
> > <f.view> does not have an attribute contentType. for the RI. does it have
> > such an attribute in MyFaces?
> >
> > Am 23.07.2007 um 23:23 schrieb noah:
> >
> >
> > I can confirm that it does.
> > <f:view contentType="text/html"> seems to be a necessity if you want
> > Dojo to work.
> >
> > On 7/23/07, Adam Winer <aw...@gmail.com> wrote:
> > In Facelets, setting contentType on f:view should do
> > the trick, but I don't know for sure.
> > > >>
> >
> > ...
> >
> >
> >
> > > >> On 7/23/07, Burghard Britzke <bu...@charmides.in-berlin.de> wrote:
> > > >> > hi,
> > > >> > sometimes the <tr:document> decides to render xhtml and sometimes
> > > >> > html4.01. how to control it?
>
>
>
> --
> Matthias Wessendorf
>
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> mail: matzew-at-apache-dot-org
>

Re: [Trinidad] breadcrumbs

Posted by Matt Cooper <ma...@gmail.com>.
Hi Kevin,

I believe the breadCrumb component displays current path down the hierarchy
of the MenuModel.  It does not replicate the browser history from your back
button's menu.

Regards,
Matt

On 7/25/07, Kevin R. Gutch <kg...@protechemail.com> wrote:
>
> Ok Thanks for the information!
>
>
>
> Simon Lessard wrote:
> > Hello Kevin,
> >
> > You can also set the breadcrumb with a MenuModel object set as the
> > breadcrumb's value and a nodeStamp facet. If you want to have the
> > breadcrumb display the real navigation the user made you'll have to
> > create your own implementation of MenuModel for that purpose and it
> > will most likely requires a PhaseListener as well to register the
> > visited viewIds. That being said, this request was made quite often
> > and I think we should consider adding such an implementation directly
> > in Trinidad for future releases.
> >
> >
> > Regards,
> >
> > ~ Simon
> >
> > On 7/25/07, *Kevin R. Gutch* <kgutch@protechemail.com
> > <ma...@protechemail.com>> wrote:
> >
> >     Hello,
> >
> >     Can the Trinidad breadcrumb component dynamically display a
> breadcrumb
> >     based on navigation or must a breadcrumb be hard coded? The example
> I
> >     have seen seems to only show
> >     tr:commandNavigationItem  inside the breadcrumb component.
> >
> >
> >     <tr:breadCrumbs orientation="vertical">
> >                 <tr:commandNavigationItem text="Table Demo"
> >     action="guide.table"/>
> >                 <tr:commandNavigationItem text="Tree Demo"
> >     action="guide.tree"/>
> >                 <tr:commandNavigationItem text="PanelPage Demo"
> >     action="guide.panelPage"/>
> >                 <tr:commandNavigationItem text="BreadCrumbs Demo"
> >     action="guide.breadCrumbs"/>
> >
> >     Thanks,
> >
> >     Kevin
> >
> >
>
>

Re: [Trinidad] breadcrumbs

Posted by "Kevin R. Gutch" <kg...@protechemail.com>.
Ok Thanks for the information!



Simon Lessard wrote:
> Hello Kevin,
>
> You can also set the breadcrumb with a MenuModel object set as the 
> breadcrumb's value and a nodeStamp facet. If you want to have the 
> breadcrumb display the real navigation the user made you'll have to 
> create your own implementation of MenuModel for that purpose and it 
> will most likely requires a PhaseListener as well to register the 
> visited viewIds. That being said, this request was made quite often 
> and I think we should consider adding such an implementation directly 
> in Trinidad for future releases.
>
>
> Regards,
>
> ~ Simon
>
> On 7/25/07, *Kevin R. Gutch* <kgutch@protechemail.com 
> <ma...@protechemail.com>> wrote:
>
>     Hello,
>
>     Can the Trinidad breadcrumb component dynamically display a breadcrumb
>     based on navigation or must a breadcrumb be hard coded? The example I
>     have seen seems to only show
>     tr:commandNavigationItem  inside the breadcrumb component.
>
>
>     <tr:breadCrumbs orientation="vertical">
>                 <tr:commandNavigationItem text="Table Demo"
>     action="guide.table"/>
>                 <tr:commandNavigationItem text="Tree Demo"
>     action="guide.tree"/>
>                 <tr:commandNavigationItem text="PanelPage Demo"
>     action="guide.panelPage"/>
>                 <tr:commandNavigationItem text="BreadCrumbs Demo"
>     action="guide.breadCrumbs"/>
>
>     Thanks,
>
>     Kevin
>
>

Re: [Trinidad] breadcrumbs

Posted by Simon Lessard <si...@gmail.com>.
Hello Kevin,

You can also set the breadcrumb with a MenuModel object set as the
breadcrumb's value and a nodeStamp facet. If you want to have the breadcrumb
display the real navigation the user made you'll have to create your own
implementation of MenuModel for that purpose and it will most likely
requires a PhaseListener as well to register the visited viewIds. That being
said, this request was made quite often and I think we should consider
adding such an implementation directly in Trinidad for future releases.


Regards,

~ Simon

On 7/25/07, Kevin R. Gutch <kg...@protechemail.com> wrote:
>
> Hello,
>
> Can the Trinidad breadcrumb component dynamically display a breadcrumb
> based on navigation or must a breadcrumb be hard coded? The example I
> have seen seems to only show
> tr:commandNavigationItem  inside the breadcrumb component.
>
>
> <tr:breadCrumbs orientation="vertical">
>             <tr:commandNavigationItem text="Table Demo"
> action="guide.table"/>
>             <tr:commandNavigationItem text="Tree Demo" action="guide.tree
> "/>
>             <tr:commandNavigationItem text="PanelPage Demo"
> action="guide.panelPage"/>
>             <tr:commandNavigationItem text="BreadCrumbs Demo"
> action="guide.breadCrumbs"/>
>
> Thanks,
>
> Kevin
>
>

[Trinidad] breadcrumbs

Posted by "Kevin R. Gutch" <kg...@protechemail.com>.
Hello,

Can the Trinidad breadcrumb component dynamically display a breadcrumb 
based on navigation or must a breadcrumb be hard coded? The example I 
have seen seems to only show
tr:commandNavigationItem  inside the breadcrumb component.


<tr:breadCrumbs orientation="vertical">
            <tr:commandNavigationItem text="Table Demo" 
action="guide.table"/>
            <tr:commandNavigationItem text="Tree Demo" action="guide.tree"/>
            <tr:commandNavigationItem text="PanelPage Demo" 
action="guide.panelPage"/>
            <tr:commandNavigationItem text="BreadCrumbs Demo" 
action="guide.breadCrumbs"/>
 
Thanks,

Kevin

Re: [Trinidad] when it decides to render xhtml and when to render html 4.01?

Posted by Matthias Wessendorf <ma...@apache.org>.
https://facelets.dev.java.net/source/browse/facelets/src/java/com/sun/facelets/tag/jsf/core/ViewHandler.java?rev=1.4&view=markup


public ViewHandler(TagConfig config) {
        super(config);
...
        this.encoding = this.getAttribute("encoding");
...
    }
...
if (this.contentType != null) {
                String v = this.contentType.getValue(ctx);

ctx.getFacesContext().getExternalContext().getRequestMap().put("facelets.ContentType",
v);
            }

On 7/25/07, Burghard Britzke <bu...@charmides.in-berlin.de> wrote:
>  but it is true:
>
>
> <f:view
>    xmlns:f="http://java.sun.com/jsf/core"
>    xmlns:tr="http://myfaces.apache.org/trinidad">
>    <tr:document>
>    </tr:document>
> </f:view>
>
> renders as
>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ...
>
> and
>
>
> <f:view contentType="text/xml"
>    xmlns:f="http://java.sun.com/jsf/core"
>    xmlns:tr="http://myfaces.apache.org/trinidad">
>    <tr:document>
>    </tr:document>
> </f:view>
>
> renders as
>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...
>
>
> Am 25.07.2007 um 10:00 schrieb Burghard Britzke:
>
> <f.view> does not have an attribute contentType. for the RI. does it have
> such an attribute in MyFaces?
>
> Am 23.07.2007 um 23:23 schrieb noah:
>
>
> I can confirm that it does.
> <f:view contentType="text/html"> seems to be a necessity if you want
> Dojo to work.
>
> On 7/23/07, Adam Winer <aw...@gmail.com> wrote:
> In Facelets, setting contentType on f:view should do
> the trick, but I don't know for sure.
> > >>
>
> ...
>
>
>
> > >> On 7/23/07, Burghard Britzke <bu...@charmides.in-berlin.de> wrote:
> > >> > hi,
> > >> > sometimes the <tr:document> decides to render xhtml and sometimes
> > >> > html4.01. how to control it?


-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org

Re: [Trinidad] when it decides to render xhtml and when to render html 4.01?

Posted by Burghard Britzke <bu...@charmides.in-berlin.de>.
but it is true:

<f:view
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:tr="http://myfaces.apache.org/trinidad">
    <tr:document>
    </tr:document>
</f:view>

renders as

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ...

and

<f:view contentType="text/xml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:tr="http://myfaces.apache.org/trinidad">
    <tr:document>
    </tr:document>
</f:view>

renders as

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...

Am 25.07.2007 um 10:00 schrieb Burghard Britzke:

> <f.view> does not have an attribute contentType. for the RI. does  
> it have such an attribute in MyFaces?
>
> Am 23.07.2007 um 23:23 schrieb noah:
>
>> I can confirm that it does.
>> <f:view contentType="text/html"> seems to be a necessity if you want
>> Dojo to work.
>>
>> On 7/23/07, Adam Winer <aw...@gmail.com> wrote:
>>> In Facelets, setting contentType on f:view should do
>>> the trick, but I don't know for sure.
>>> > >>

...

>>> > >> On 7/23/07, Burghard Britzke <bu...@charmides.in-berlin.de>  
>>> wrote:
>>> > >> > hi,
>>> > >> > sometimes the <tr:document> decides to render xhtml and  
>>> sometimes
>>> > >> > html4.01. how to control it?

Re: [Trinidad] when it decides to render xhtml and when to render html 4.01?

Posted by Burghard Britzke <bu...@charmides.in-berlin.de>.
<f.view> does not have an attribute contentType. for the RI. does it  
have such an attribute in MyFaces?

Am 23.07.2007 um 23:23 schrieb noah:

> I can confirm that it does.
> <f:view contentType="text/html"> seems to be a necessity if you want
> Dojo to work.
>
> On 7/23/07, Adam Winer <aw...@gmail.com> wrote:
>> In Facelets, setting contentType on f:view should do
>> the trick, but I don't know for sure.
>>
>> -- Adam
>>
>>
>> On 7/23/07, Burghard Britzke <bu...@charmides.in-berlin.de> wrote:
>> > and for facelets? is it possible to set the content type, too?
>> > for facelets .xhtml files it rendered html 4.01.
>> >
>> > Am 23.07.2007 um 19:58 schrieb Adam Winer:
>> >
>> > > Funny, I should have remembered:
>> > > https://issues.apache.org/jira/browse/TRINIDAD-78
>> > > ... since I fixed it myself...
>> > >
>> > > Looks like it's this simple:  set the contentType of your
>> > > JSP page to be XHTML, get XHTML output.  And,
>> > > if you fail to set a content type, then by default
>> > > you get HTML for .jsp pages, XHTML for .jspx
>> > > documents.
>> > >
>> > > -- Adam
>> > >
>> > >
>> > > On 7/23/07, Adam Winer <aw...@gmail.com> wrote:
>> > >> As best I know, we never render XHTML, so I'm surprised to
>> > >> hear otherwise.
>> > >>
>> > >> -- Adam
>> > >>
>> > >>
>> > >> On 7/23/07, Burghard Britzke <bu...@charmides.in-berlin.de>  
>> wrote:
>> > >> > hi,
>> > >> > sometimes the <tr:document> decides to render xhtml and  
>> sometimes
>> > >> > html4.01. how to control it?
>> > >> >
>> > >> >
>> > >>
>> >
>> >
>>


Re: [Trinidad] when it decides to render xhtml and when to render html 4.01?

Posted by noah <ia...@gmail.com>.
I can confirm that it does.
<f:view contentType="text/html"> seems to be a necessity if you want
Dojo to work.

On 7/23/07, Adam Winer <aw...@gmail.com> wrote:
> In Facelets, setting contentType on f:view should do
> the trick, but I don't know for sure.
>
> -- Adam
>
>
> On 7/23/07, Burghard Britzke <bu...@charmides.in-berlin.de> wrote:
> > and for facelets? is it possible to set the content type, too?
> > for facelets .xhtml files it rendered html 4.01.
> >
> > Am 23.07.2007 um 19:58 schrieb Adam Winer:
> >
> > > Funny, I should have remembered:
> > > https://issues.apache.org/jira/browse/TRINIDAD-78
> > > ... since I fixed it myself...
> > >
> > > Looks like it's this simple:  set the contentType of your
> > > JSP page to be XHTML, get XHTML output.  And,
> > > if you fail to set a content type, then by default
> > > you get HTML for .jsp pages, XHTML for .jspx
> > > documents.
> > >
> > > -- Adam
> > >
> > >
> > > On 7/23/07, Adam Winer <aw...@gmail.com> wrote:
> > >> As best I know, we never render XHTML, so I'm surprised to
> > >> hear otherwise.
> > >>
> > >> -- Adam
> > >>
> > >>
> > >> On 7/23/07, Burghard Britzke <bu...@charmides.in-berlin.de> wrote:
> > >> > hi,
> > >> > sometimes the <tr:document> decides to render xhtml and sometimes
> > >> > html4.01. how to control it?
> > >> >
> > >> >
> > >>
> >
> >
>

Re: [Trinidad] when it decides to render xhtml and when to render html 4.01?

Posted by Adam Winer <aw...@gmail.com>.
In Facelets, setting contentType on f:view should do
the trick, but I don't know for sure.

-- Adam


On 7/23/07, Burghard Britzke <bu...@charmides.in-berlin.de> wrote:
> and for facelets? is it possible to set the content type, too?
> for facelets .xhtml files it rendered html 4.01.
>
> Am 23.07.2007 um 19:58 schrieb Adam Winer:
>
> > Funny, I should have remembered:
> > https://issues.apache.org/jira/browse/TRINIDAD-78
> > ... since I fixed it myself...
> >
> > Looks like it's this simple:  set the contentType of your
> > JSP page to be XHTML, get XHTML output.  And,
> > if you fail to set a content type, then by default
> > you get HTML for .jsp pages, XHTML for .jspx
> > documents.
> >
> > -- Adam
> >
> >
> > On 7/23/07, Adam Winer <aw...@gmail.com> wrote:
> >> As best I know, we never render XHTML, so I'm surprised to
> >> hear otherwise.
> >>
> >> -- Adam
> >>
> >>
> >> On 7/23/07, Burghard Britzke <bu...@charmides.in-berlin.de> wrote:
> >> > hi,
> >> > sometimes the <tr:document> decides to render xhtml and sometimes
> >> > html4.01. how to control it?
> >> >
> >> >
> >>
>
>

Re: [Trinidad] when it decides to render xhtml and when to render html 4.01?

Posted by Burghard Britzke <bu...@charmides.in-berlin.de>.
and for facelets? is it possible to set the content type, too?
for facelets .xhtml files it rendered html 4.01.

Am 23.07.2007 um 19:58 schrieb Adam Winer:

> Funny, I should have remembered:
> https://issues.apache.org/jira/browse/TRINIDAD-78
> ... since I fixed it myself...
>
> Looks like it's this simple:  set the contentType of your
> JSP page to be XHTML, get XHTML output.  And,
> if you fail to set a content type, then by default
> you get HTML for .jsp pages, XHTML for .jspx
> documents.
>
> -- Adam
>
>
> On 7/23/07, Adam Winer <aw...@gmail.com> wrote:
>> As best I know, we never render XHTML, so I'm surprised to
>> hear otherwise.
>>
>> -- Adam
>>
>>
>> On 7/23/07, Burghard Britzke <bu...@charmides.in-berlin.de> wrote:
>> > hi,
>> > sometimes the <tr:document> decides to render xhtml and sometimes
>> > html4.01. how to control it?
>> >
>> >
>>


Re: [Trinidad] when it decides to render xhtml and when to render html 4.01?

Posted by Adam Winer <aw...@gmail.com>.
Funny, I should have remembered:
https://issues.apache.org/jira/browse/TRINIDAD-78
... since I fixed it myself...

Looks like it's this simple:  set the contentType of your
JSP page to be XHTML, get XHTML output.  And,
if you fail to set a content type, then by default
you get HTML for .jsp pages, XHTML for .jspx
documents.

-- Adam


On 7/23/07, Adam Winer <aw...@gmail.com> wrote:
> As best I know, we never render XHTML, so I'm surprised to
> hear otherwise.
>
> -- Adam
>
>
> On 7/23/07, Burghard Britzke <bu...@charmides.in-berlin.de> wrote:
> > hi,
> > sometimes the <tr:document> decides to render xhtml and sometimes
> > html4.01. how to control it?
> >
> >
>

Re: [Trinidad] when it decides to render xhtml and when to render html 4.01?

Posted by Adam Winer <aw...@gmail.com>.
As best I know, we never render XHTML, so I'm surprised to
hear otherwise.

-- Adam


On 7/23/07, Burghard Britzke <bu...@charmides.in-berlin.de> wrote:
> hi,
> sometimes the <tr:document> decides to render xhtml and sometimes
> html4.01. how to control it?
>
>