You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Vladimir Isakovich <iv...@gmail.com> on 2007/06/27 05:23:30 UTC

Facelets question

Can someone share an idea of avoiding the following repetative code in every
.xhtml file. Am I missing some already existing custom tag?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition template="layout/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
      	xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:my="http://www.mycompany.com/jsf"
        xmlns:t="http://myfaces.apache.org/tomahawk"
      	xmlns:f="http://java.sun.com/jsf/core"
      	xmlns:h="http://java.sun.com/jsf/html">

        ......... page specific code with ui:definitions referring to
all those libraries...................

</ui:composition>


I'm using
Facelets 1.1.11
Tomahawk 1.1.3
MyFaces 1.1.3
Tomcat 5.5.17

Re: Facelets question

Posted by Scott O'Bryan <da...@gmail.com>.
Vlad,

Yes, the entities will be parsed by the browser, not the jsp engine.  So 
that would be too late for the faces tags to refer to them.

Scott

Vladimir Isakovich wrote:
> You're probabli right. Unfortunately.
> I was able to add :
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
> [<!ENTITY section SYSTEM "section.xml">]>
>  
> but was not able to refer to this entity as
> &section;
> inside facelets tags. Probably this is a dead-end.
>  
> Also, even if it works - this is not what I was lookin for, I was more 
> interested in a way of hooking up a container file while calling an 
> inner file.
>
>  
> On 6/27/07, *Nebinger, David* <dnebinger@tbbgl.com 
> <ma...@tbbgl.com>> wrote:
>
>     Each xhtml file is a standalone XML document and is expected to
>     conform to XML standards.  The doctype and namespace declarations
>     ensure that your page can be rendered.
>      
>     Therefore the repetitive block is required for each page; you
>     cannot remove it w/o your pages failing miserably.
>
>         ------------------------------------------------------------------------
>         *From:* Vladimir Isakovich [mailto:ivlad10@gmail.com
>         <ma...@gmail.com>]
>         *Sent:* Tuesday, June 26, 2007 11:24 PM
>         *To:* users@myfaces.apache.org <ma...@myfaces.apache.org>
>         *Subject:* Facelets question
>
>          
>         Can someone share an idea of avoiding the following repetative
>         code in every .xhtml file. Am I missing some already existing
>         custom tag?
>
>         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>         " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
>         <ui:composition template=
>         "layout/template.xhtml"
>
>         	xmlns="http://www.w3.org/1999/xhtml"
>               	xmlns:ui="http://java.sun.com/jsf/facelets"
>                 xmlns:my="http://www.mycompany.com/jsf"
>                 xmlns:t="http://myfaces.apache.org/tomahawk"
>               	xmlns:f="http://java.sun.com/jsf/core"
>               	xmlns:h="http://java.sun.com/jsf/html">
>          
>                 ......... page specific code with ui:definitions referring to all those libraries...................
>          
>         </ui:composition>
>               
>
>
>         I'm using
>         Facelets 1.1.11
>         Tomahawk 1.1.3
>         MyFaces 1.1.3
>         Tomcat 5.5.17
>
>


Re: Facelets question

Posted by Vladimir Isakovich <iv...@gmail.com>.
You're probabli right. Unfortunately.
I was able to add :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
[<!ENTITY section SYSTEM "section.xml">]>

but was not able to refer to this entity as
&section;
inside facelets tags. Probably this is a dead-end.

Also, even if it works - this is not what I was lookin for, I was more
interested in a way of hooking up a container file while calling an inner
file.


On 6/27/07, Nebinger, David <dn...@tbbgl.com> wrote:
>
>  Each xhtml file is a standalone XML document and is expected to conform
> to XML standards.  The doctype and namespace declarations ensure that your
> page can be rendered.
>
> Therefore the repetitive block is required for each page; you cannot
> remove it w/o your pages failing miserably.
>
>  ------------------------------
> *From:* Vladimir Isakovich [mailto:ivlad10@gmail.com]
> *Sent:* Tuesday, June 26, 2007 11:24 PM
> *To:* users@myfaces.apache.org
> *Subject:* Facelets question
>
>
>  Can someone share an idea of avoiding the following repetative code in
> every .xhtml file. Am I missing some already existing custom tag?
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <ui:composition template="layout/template.xhtml"
> 	xmlns="http://www.w3.org/1999/xhtml"
>       	xmlns:ui="http://java.sun.com/jsf/facelets"
>         xmlns:my="http://www.mycompany.com/jsf"
>         xmlns:t="http://myfaces.apache.org/tomahawk"
>       	xmlns:f="http://java.sun.com/jsf/core"
>       	xmlns:h="http://java.sun.com/jsf/html">
>
>         ......... page specific code with ui:definitions referring to all those libraries...................
>
> </ui:composition>
>
>
> I'm using
> Facelets 1.1.11
> Tomahawk 1.1.3
> MyFaces 1.1.3
> Tomcat 5.5.17
>
>

RE: Facelets question

Posted by "Nebinger, David" <dn...@tbbgl.com>.
Each xhtml file is a standalone XML document and is expected to conform
to XML standards.  The doctype and namespace declarations ensure that
your page can be rendered.
 
Therefore the repetitive block is required for each page; you cannot
remove it w/o your pages failing miserably.


________________________________

	From: Vladimir Isakovich [mailto:ivlad10@gmail.com] 
	Sent: Tuesday, June 26, 2007 11:24 PM
	To: users@myfaces.apache.org
	Subject: Facelets question
	
	
	Can someone share an idea of avoiding the following repetative
code in every .xhtml file. Am I missing some already existing custom
tag?
	
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	
	
	<ui:composition template="layout/template.xhtml"
	
		xmlns="http://www.w3.org/1999/xhtml"
	      	xmlns:ui="http://java.sun.com/jsf/facelets"
	        xmlns:my="http://www.mycompany.com/jsf"
	        xmlns:t="http://myfaces.apache.org/tomahawk"
	      	xmlns:f="http://java.sun.com/jsf/core"
	      	xmlns:h="http://java.sun.com/jsf/html">
	 
	        ......... page specific code with ui:definitions
referring to all those libraries...................
	 
	</ui:composition>

	I'm using
	Facelets 1.1.11
	Tomahawk 1.1.3
	MyFaces 1.1.3
	Tomcat 5.5.17