List Info

Thread: Templates not picking up stylesheet




Templates not picking up stylesheet
user name
2006-11-27 19:34:40

Is anyone else having a problem using stylesheets with Facelets templates?&nbsp; I have a template file, template.xhtml that simply defines my layout using <ui:insert name=̶1;xyz”;/>, and at the top of the file I have the snippet listed below.&nbsp; My initial page looks great, but when I navigate to another page in which only the body changes, the header and footer do not continue to use the stylesheet

 

Could someone please explain to me what I might be doing wrong?  This problem only occurs with Firefox, both versions 1.5 and 2.0; in IE 6.x the stylesheet is used on all pages as expected.&nbsp; I only seem to have this problem when I use Facelets, so I’m hoping someone here might have seen this. ; As you can see, defaultStyles.css is replacing my project217;s stylesheet. ; I am running this on Glassfish v2 build 23 (problem happens with Tomcat and other versions of Glassfish as well).&nbsp;

 

 

 

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

<html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;

 &nbsp; &nbsp;  xmlns:ui=&quot;http://java.sun.com/jsf/facelets"

 &nbsp; &nbsp;  xmlns:f=&quot;http://java.sun.com/jsf/core&quot;

 &nbsp; &nbsp;  xmlns:h=&quot;http://java.sun.com/jsf/html&quot;

 &nbsp; &nbsp;  xmlns:c=&quot;http://java.sun.com/jstl/core&quot;

 &nbsp; &nbsp;  xmlns:t=&quot;http://myfaces.apache.org/tomahawk"&gt;

 

 &nbsp;  <f:view locale=&quot;#{facesContext.externalContext.request.locale}"> &nbsp; 

 &nbsp; &nbsp; &nbsp;  <head&gt;

 &nbsp; &nbsp; &nbsp; &nbsp;   ; <meta http-equiv="Content-Type&quot; content=&quot;text/html; charset=iso-8859-1" />

 &nbsp; &nbsp; &nbsp; &nbsp;   ; <title>#{msg.project_name}: #{msg.project_long_name}</title>

 &nbsp; &nbsp; &nbsp; &nbsp;   ; <link href="#{facesContext.externalContext.request.contextPath}/resources/styles.css"; rel=";stylesheet" type=";text/css&quot; />&nbsp;   ; &nbsp; &nbsp; &nbsp; 

 &nbsp; &nbsp; &nbsp; &nbsp;   ; <f:loadBundle basename=&quot;com.lmco.gems.resources.global" var="msg" />

 &nbsp; &nbsp; &nbsp; &nbsp;   ;

 &nbsp; &nbsp; &nbsp;  </head&gt;

 

 

This is what my browser gets using Firefox:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"; "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot; >
<html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;>&nbsp;   
 &nbsp; &nbsp; &nbsp; &nbsp;<head>
<link rel=&quot;stylesheet" href=&quot;/MyProject/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11646488/tabbedpane.HtmlTabbedPaneRenderer/defaultStyles.css" type="text/css" />
<script type=&quot;text/javascript&quot; src="/MyProject/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11646488/tabbedpane.HtmlTabbedPaneRenderer/dynamicTabs.js"&gt;<!--
 
//--></script>
<style rel="stylesheet"; type="text/css"><!--
#j_id76_j_id79 .myFaces_panelTabbedPane_activeHeaderCell input,
#j_id76_j_id79 .myFaces_panelTabbedPane_pane,
#j_id76_j_id79 .myFaces_panelTabbedPane_subHeaderCell{
background-color:#FFFFCC;
}
 
-->&lt;/style>

 

 

This is what my browser gets using IE 6.x:

 

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

<html xmlns="http://www.w3.org/1999/xhtml";>   ;

 &nbsp; &nbsp; &nbsp;  <head&gt;

<link rel="stylesheet&quot; href=";/MyProject/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11646488/tabbedpane.HtmlTabbedPaneRenderer/defaultStyles.css&quot; type="text/css" />

<script type=";text/javascript" src="/MyProject/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11646488/tabbedpane.HtmlTabbedPaneRenderer/dynamicTabs.js";><!--

 

//-->&lt;/script&gt;

<style rel="stylesheet&quot; type="text/css"&gt;<!--

#j_id76_j_id79 .myFaces_panelTabbedPane_activeHeaderCell input,

#j_id76_j_id79 .myFaces_panelTabbedPane_pane,

#j_id76_j_id79 .myFaces_panelTabbedPane_subHeaderCell{

background-color:#FFFFCC;

}

 

--></style>

 

 

 

TR

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )