Tiles, jsf and css

Hi,
I use JSF with Tiles for the first time to built a web application.
I have a problem with my stylesheet which I use for my layout and the other pieces of pages.
When I start my application, the first page works and the look and feel uses the stylesheet. But when I call an other page, the stylesheet isn't apply. I know there is a problem with the context path ...
For the moment, I declare my stylesheet like that :
<link rel="stylesheet" href="/css/style.css" type="text/css">
So, it works only the the first page.
I tried like this, thanks to the struts html tags :
<link rel="stylesheet" href="<html:rewrite page='/css/style.css'/>" type="text/css">
but this time, i have an error :
[ServletException in:/tiles/layout.jsp] org.apache.struts.taglib.html.MessagesTei'
If someone has a solution ...
thanks..

Will you please explain to me how you are doing CSS layout? I am having a problem with JSF 1.1 RI as everything is in a <td>. I want to get rid of these and change the rendered markup to output <div>s unless I can alter the location of <td>s on the page. This sounds like it would break the table model, so I doubt this is possible.
Thank you for any input,
TacoEater

Similar Messages

  • Jsf and css id selector

    Jsf uses a colon (:) for component ids, however to the best of my knowledge, that's an illegal css character. Has anyone had any luck escaping that char with a backslash or is there some other means besides using the style or styleclass attribute in your JSF page to apply styles to a jsf component?
    Thanks,
    Justin

    The first (and I am hoping worst) solution that springs to mind is using JavaScript and the DOM in an onLoad handler for the page.
    According to what I see in the CSS specification, it looks like backslash escaping should work, I take it you have tried it and it does not? There is also a Unicode escape where : should be \3A
    Another possibility would be to wrap the component in a span or div with a known id and apply rules from there.

  • Jsf and tiles

    hi all.
    i'm developing an application using jsf and tiles.
    i've some problem in the general layout page.
    how can I refer to images and files,if I don't know where the page will be used?
    with struts i've used <html:rewrite page=" ... " /> but it doesn't work with jsf.
    I only use the TilesServlet.
    any suggestion?
    i've also try to define the url like "/css/mycss.css" but in local dosn't work.
    thank a lot for any reply!

    hi all.
    i'm developing an application using jsf and tiles.
    i've some problem in the general layout page.
    how can I refer to images and files,if I don't know where the page will be used?
    with struts i've used <html:rewrite page=" ... " /> but it doesn't work with jsf.
    I only use the TilesServlet.
    any suggestion?
    i've also try to define the url like "/css/mycss.css" but in local dosn't work.
    thank a lot for any reply!

  • Issue in using JSF and tiles

    Hai,
    I am using JSF and tiles in my application along with richfaces 3.2 jar but the suggestion box does not work when i use incorporate tiles to the jsp page,Please help me out.Here is my code
    Content Page
    <%@ taglib prefix= "f" uri="http://java.sun.com/jsf/core"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"  %>
    <%@ taglib uri="http://java.sun.com/jsf/core"   prefix="f"  %>
    <%@ taglib uri="http://java.sun.com/jsf/html"   prefix="h"  %>
    <%@ taglib uri="http://jakarta.apache.org/tiles"  prefix="tiles"  %>
         <f:view >
             <link href="<%=request.getContextPath()%>\styles\Form.css" rel="stylesheet" type="text/css"/>
             <link href="<%=request.getContextPath()%>\styles\Menu.css" rel="stylesheet" type="text/css"/>
             <link href="<%=request.getContextPath()%>\styles\Header.css" rel="stylesheet" type="text/css"/>
             <title><h:outputText value="Brand"/></title>
             <h:form id="testForm">
                 <tiles:insert definition="test_create" flush="false"/>
             </h:form>
         </f:view>JSP
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
    <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <f:subview id="come">
    <body>
    <h:form>
    <h:outputText value="Provider:" styleClass="SubTitle" />
    <h:inputText value="#{testMBean.property}" size="25" id="dpiSuggest" styleClass="SubTitle">
        <a4j:support event="onkeyup" />
    </h:inputText>   
    <rich:suggestionbox for="dpiSuggest" suggestionAction="#{testMBean.suggest}" height="180" width="180" var="suggest">
    <h:column>
    <h:outputText value="#{suggest.countryName}" />
    </h:column>
    <h:column>
    <h:outputText value="#{suggest.countryCode}" />
    </h:column>
    </rich:suggestionbox>
    </h:form>
    </body>
    </f:subview>
    </html>
    *tiles.xml*
    <tiles-definitions>
        <definition name="header-menu-content" path="/layout/basicLayout.jsp">
            <put name="gridClass"           value="headerMenuContent"/>  
            <put name="headerClass"         value="HeaderBgcolor"/>
            <put name="menuColumnClass"     value="MenuBorder"/>
            <put name="contentColumnClass"  value="BodyBgColor"/>
        </definition>
        <definition name="home" extends="header-menu-content">
            <put name="header"  value="/common/header.jsp"/>
            <put name="menu"    value="/common/menu.jsp"/>
            <!--<put name="buttonBar" value="/common/buttonBar.jsp"/>-->
            <put name="content" value="/common/home.jsp"/>     
        </definition>
        <definition name="error" extends="header-menu-content">
            <put name="header"  value="/common/header.jsp"/>
            <put name="menu"    value="/common/menu.jsp"/>
            <!--<put name="buttonBar" value="/common/buttonBar.jsp"/>-->
            <put name="content" value="/common/error.jsp"/>     
        </definition>
            <definition  name="test_create" extends="header-menu-content">
                 <put name="header" value="/common/header.jsp" />
                 <put name="menu" value="/common/menu.jsp" />
                 <!-- <put name="buttonBar" value="/common/buttonBar.jsp"/>-->
                 <put name="content" value="/test.jsp" />
             </definition>
        <tiles-definitions>
    *web.xml*
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>welcome.jsp</welcome-file>
            </welcome-file-list>
             <context-param>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>false</param-value>
      </context-param>
      <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
      </context-param>
      <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
      </context-param>
      <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
      </servlet-mapping>
    <context-param>
      <param-name>org.richfaces.SKIN</param-name>
      <param-value>blueSky</param-value>
      </context-param>
    <filter>
      <display-name>RichFaces Filter</display-name>
      <filter-name>richfaces</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>
      </filter>
    <filter-mapping>
      <filter-name>richfaces</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>
            <servlet>
          <servlet-name>Tiles Servlet</servlet-name>
          <servlet-class>org.apache.tiles.servlets.TilesServlet</servlet-class>
          <init-param>
             <param-name>definitions-config</param-name>
             <param-value>/WEB-INF/tiles.xml</param-value>
          </init-param>
          <load-on-startup>2</load-on-startup>
       </servlet>
        </web-app>
    *facesconfig.xml*
    <?xml version="1.0" encoding="UTF-8"?>
    <faces-config version="1.2"
                  xmlns="http://java.sun.com/xml/ns/javaee"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
        <navigation-rule>
                <navigation-case> <!-- Displayes the screen to add data -->
                <from-outcome>test</from-outcome>
                <to-view-id>/testContent.jsp</to-view-id>
                <redirect/>
            </navigation-case>
        </navigation-rule>
        <managed-bean>
            <managed-bean-name>testMBean</managed-bean-name>
            <managed-bean-class>testMBean</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
      </faces-config>Edited by: SreeramIyer on May 29, 2008 4:50 AM

    Are you dead set on using tiles? I can see tiles including JSF but JSF including tiles? Not sure if that will work.
    My suggestion is to use Trinidad. It has the concept of Regions which is very "tiles" like and you will be far more successful.

  • How to  include external javascript and css resources to a jsf?

    I need to include external css and javascript files to my jsf page. Using the code below does not work because all the styles on the css page are ignored and the functions within the js files are not executed.
    <link rel="stylesheet" type="text/css" href="/resources/styles/style.css" />
    <script language="JavaScript" src="/resources/javascript/util.js"></script>When I try to execute any js function within a script tag on a jsf page I get an object expected error.
    I googled about my problem and found this piece of code for importing styles for an external css.
    <style type="text/css">
    @import url("/resources/styles/style.css");
    </style>How could I add an external javascript file to my jsf?

    Used the relative urls in my first post as well as these, and both were not working.
    <link rel="stylesheet" type="text/css" href="./resources/styles/style.css" />
    <script language="JavaScript" src="./resources/javascript/util.js"></script>The ./ tells that the external file can be found by starting at the current directory and working down the path to the specified file. This is my directory structure. Index.jsf is the file that references the external js and css files.
    -Webcontent
    |_index.jsf
    |_resources
    |__styles
    | |__style.css
    |__javascript
    |__util.js
    Either way I still can't reference the files that I need. Calling a javascript function results in an object expected error, and the styles are ignored.
    If I include the js file directly in the jsf then I can get it to work. I don't want to do this because I have created a handful of seperate js files, and do not want to include all of them in one page. I am using myfaces and tomahawk if that helps.

  • JSF, tiles, xml and xsl

    Good days people, I am employed at an app that wants to integrate JSF, tiles, xml and xsl.
    Basically the app receives information of the user's interfaz, builds an url with the above mentioned information and invokes to a service web that a xml returns with the information. The idea is to generate the exit in format html or wml with an insole(staff) xsl and to send the result in this format to every jsp that is going to form a part of the page that it will generate tiles. at first I understand that it is feasible, i�d like to know if someone already has done it and since it has done it.
    Just now what I have is a managed bean that receives the parameters of the altar frontal and invokes a method of a service, like this:
    public String encuentra(){
    //deja los atributos privados rellenos.
    String mensaje ;
    crearYRellenarBusquedaVO();
    try {
    setResultado(this.getServicio().obtenerResultadosWML(this.getBusquedaVO()));
    mensaje="succesNoJS";
    }catch(java.lang.IllegalArgumentException e){
    mensaje="error";
    }catch(es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException e1){
    mensaje="error";
    }catch(Exception e2){
    mensaje="error";
    return mensaje;
    public String obtenerResultadosWML(es.yell.frontlite.service.impl.BusquedaVO busquedaVO){
    if (busquedaVO == null){
    throw new IllegalArgumentException(
    "obtenerResultadosJSdesactivado(es.yell.frontlite.service.impl.BusquedaVO busquedaVO) - 'busquedaVO' no puede ser nulo.");
    try{
    return this.manejarObtenerResultadosWML(busquedaVO);
    }catch(es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException e1){
    throw new es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException(
    "Error ejecutando el servicio String obtenerResultadosJSdesactivado(es.yell.frontlite.service.impl.BusquedaVO busquedaVO). " + e1.getCause(),e1);
    }catch(Exception e){
    throw new es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException(
    "Error ejecutando el servicio String obtenerResultadosJSdesactivado(es.yell.frontlite.service.impl.BusquedaVO busquedaVO). " + e.getCause(),e);
    //it returns html code!
    protected String manejarObtenerResultadosWML(es.yell.frontlite.service.impl.BusquedaVO busquedaVO)
    throws java.lang.Exception{
    try{
    // xmlOrigen has full xml response from server
    String xmlOrigen = manejarObtenerResultadosJSActivado(busquedaVO);
    Source xmlSource = new StreamSource(new StringBufferInputStream(xmlOrigen));
    Source xsltSource = new StreamSource(SrvBusquedaNoxtrumServiceImpl.class.getResourceAsStream(Constantes.XSL_FILE));
    StringWriter cadenaSalida = new StringWriter();
    Result bufferResultado = new StreamResult(cadenaSalida);
    TransformerFactory factoriaTrans = TransformerFactory.newInstance();
    Transformer transformador = factoriaTrans.newTransformer(xsltSource);
    transformador.transform(xmlSource, bufferResultado);
    System.out.println(cadenaSalida.toString());
    return cadenaSalida.toString();
    }catch(Exception e2){
    throw new es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException (e2.getMessage());
    With this exit in html, since(as,like) how could i forward it towards a jsp especially?
    faces-config.xml
    <navigation-rule>
    <from-view-id>/index.jsp</from-view-id>
    <navigation-case>
    <from-outcome>succesNoJS</from-outcome>
    <to-view-id>/jsDesactivado.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>error</from-outcome>
    <to-view-id>/error.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    index.jsp
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <f:view>
    <f:loadBundle basename="MessageResources" var="msg"/>
    <head>
    <title>
    ${msg.titulo}
    </title>
    </head>
    <body>
    <h:form id="formulario">
    Que:
    <h:inputText id="campoQue" value="#{yellProxy.campoQue}" />
    Donde
    <h:inputText id="campoDonde" value="#{ yellProxy.campoDonde}" />
    <h:commandButton id="boton" value="Encuentra" action="#{yellProxy.encuentra}"/>
    </h:form>
    </f:view>
    </body>
    </html>
    jsDesactivado.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%--
    The taglib directive below imports the JSTL library. If you uncomment it,
    you must also add the JSTL library to the project. The Add Library... action
    on Libraries node in Projects view can be used to add the JSTL 1.1 library.
    --%>
    <%--
    <%@taglib uri=" http://java.sun.com/jsp/jstl/core" prefix="c"%>
    --%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    " http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <h1>JSP Page</h1>
    jsDesactivado!!
    <%--
    This example uses JSTL, uncomment the taglib directive above.
    To test, display the page like this: index.jsp?sayHello=true&name=Murphy
    --%>
    <%--
    <c:if test="${param.sayHello}">
    <!-- Let's welcome the user ${param.name} -->
    Hello ${param.name}!
    </c:if>
    --%>
    <jsp:getProperty name="yellProxy" property="resultado"/>
    </body>
    </html>
    If you could pass me a simple example of use of an app that uses JSF, tiles, xml and xsl, i�be grateful
    regards a lot!

    We too (at Viking Freight) would also be very interested to see if anybody
    has produced such a useful series of classes...
    Frank Lees, Developer
    -----Original Message-----
    From: Amin, Kamran [mailto:kamran.aminframeworkinc.com]
    Sent: Wednesday, January 19, 2000 12:11 PM
    To: 'Forte User'
    Subject: (forte-users) XML and XSL in Forte
    Has anybody integrated an XSL parser with Forte. I know Forte provides us
    with an XML parser but that does not help with parsing XSL. There a lot of
    parsers written in JAVA but that will not integrate well with Forte. We
    need something that will be easy to integrate with Forte. This parser will
    take our XML and XSL to give us a result set. If anybody can comment on the
    subject or share some information I would appreciate it.
    thanks in advance.
    ka
    For the archives, go to: http://lists.sageit.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.sageit.com

  • Jsf and tiles via myfaces

    Greetings:
    Please either confirm and/or correct following proposed solution for Myfaces tiles.
    Issue: isert a tile definition and attribute in a pure jsf page.
    First passed solution: A hybrid of Jsp programming and Jsf. I was able to create a tile page layout in pure jsf except in the portal columns i used old fashion jsp programming to insert a list of portletDefinitions which is extracted from jsf ValueBinding of its managed beans.
    The problem with the above approach is that it works well only with html portlet fragments. When a portlet fragment has some jsf elements, the page rendering has conflict of simultaneous rendering between jsf and jsp. The portlet fragments are rendered in a woring place.
    Proposed solution: use <h:dataTable ...> to render the portletList and extract the item portletDefinition as following:
    <h:dataTable var="portlet"
    value="#{portalTabbedBean.selectedPane.serviceListL}" >
    <f:verbatim>
    <h:outputText
    value="<tiles:insert name=#{portlet.portletDefinition} flush='false' /> " />
    </f:verbatim>
    </h:dataTable>
    Note on the name of tiles:insert element, which i just extracted the definition as a jsp variable to make it work in the first hybrid solution:
    <tiles:insert name="<%=portletDefinition%>" flush="false" />
    Thanks
    BaTien
    DBGROUPS

    I reply this myself. Jsf and Jsp programming either via Jstl or while loop do not go together under current version.
    I solve the problem by using Jsp programming and insert the portlet tile fragment directly rather than though a portlet template with different tile content attribute. The portlet tile is created as <h:panelGrid ...> and observe the set rules to make Jsf and jsp working together. Hopefully Jsf and Jsp will be able to work together nicely in their next specifications.

  • Using JSF and tiles

    Hi Friends,
    I'm trying to combine JSF and tiles as follows:
    Template file:
    <f:subview id="content">
    <tiles:insert attribute="content" flush="false"/>
    </f:subview>
    content file:
    <tiles:insert definition="userSpecific">
    <tiles:put name="content" type="string" >
    <h:outputText value="aaaa"/>
    </tiles:put>
    </tiles:insert>
    I get the following error when loading the content file:
    2007-06-20 10:14:10,578 [http-8080-Processor23] ERROR org.apache.myfaces.shared_impl.taglib.UIComponentTagUtils - Component javax.faces.component.UIViewRoot is no ValueHolder, cannot set value.
    I tried putting the template content in a verbatim tag and then it works
    but the content page is not displayed in correct place in the template...
    Thanks a lot in advance!

    Are you dead set on using tiles? I can see tiles including JSF but JSF including tiles? Not sure if that will work.
    My suggestion is to use Trinidad. It has the concept of Regions which is very "tiles" like and you will be far more successful.

  • Tiles + JSF error (Illegal to flush within a custom tag)

    Hi,
    When I try to use Tiles + JSF I have this error message :
    javax.servlet.jsp.JspException: Illegal to flush within a custom tag
    I am already using flush="false" on my tiles:insert tag.
    This is my .jsp code :
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
    <tiles:insert beanName="cadastro_base" beanScope="request" flush="false">
    <tiles:put name="form_body" type="string">
    <f:view>
    <h:form id="DisciplinaJsfBean" binding="#{DisciplinaJsfBean.form}" >
    <h:inputText id="codigo" binding="#{DisciplinaJsfBean.itCodigo}"/>
    </h:form>
    </f:view>
    </tiles:put>
    </tiles:insert>
    And this is the stack trace message :
    exception
    javax.servlet.ServletException: Illegal to flush within a custom tag
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspService(cadastrarDisciplinas_jsp.java:99)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    root cause
    javax.servlet.jsp.JspException: Illegal to flush within a custom tag
         com.sun.faces.taglib.jsf_core.ViewTag.doEndTag(ViewTag.java:223)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_f_view_0(cadastrarDisciplinas_jsp.java:205)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_tiles_put_0(cadastrarDisciplinas_jsp.java:157)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_tiles_insert_0(cadastrarDisciplinas_jsp.java:122)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspService(cadastrarDisciplinas_jsp.java:92)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    Danilo.

    What worked for me was to add a flush="false" to each of the <tiles:insert tags in my layout page.
    I'm using this with JSF so it may be different for you:
    ... Layout stuff ...
       <tiles:insert attribute="body" flush="false" />
    ... More layout stuff, including more inserts with the flush="false" ....

  • JSF & XHTML/CSS

    I am trying to integrate parts of a JSF app I've been making with standard HTML and CSS markup, but I'm running into serious issues. Are there a few things I need to know about how to do this properly? Few pages on the internet address the best way to go about this, though I've already read a lot of complaints about how difficult this is.
    This is a simplified version of my HTML showing one button:
    <%@ page contentType="text/html; charset=MacRoman" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <style type="text/css" media="screen">
         .button {background-color: white; width: 100%; height: 25px; cursor: pointer; font: 22px sans-serif; font-weight: bold; color: #333300;}
         .button:hover {background-color: #999966; width: 100%; height: 25px; cursor: pointer; font: 22px sans-serif; font-weight: bold; color: #666633;}
         .buttonText {position: relative; left: 30px; background-color: white; width: 300px; line-height: 25px;}
    </style>
    </head>
    <body>
    <div class="button">
         <div class="buttonText">
              Create New
         </div>
    </div>
    </body>
    </html>I would like to have the above page in JSF and have the Create New button act as a commandlink, but with the appropriate style applied.
    So far I haven't been able to achieve this.
    My first question is what to do with the doctype declarations and the other elements that make this page XHTML valid. I tried removing them, but the page did not display correctly in all browsers, and so I put them back in. Is this going to cause any problems at all, or is it something I should be doing anyway? I just felt funny with a JSP page with XHTML declarations, but then again if the JSP is just going to produce markup it should have it.
    My HTML page has a fair bit of markup and a small amount of JSF components.
    Should I&#8230;
    -start the <f:view><h:form> tags at the top and end at the bottom while enclosing all the html in <f:verbatim> tags?
    -start the <f:view><h:form> at the latest possible times, enclose the HTML within that with <f:verbatim> and leave the rest of the HTML alone?
    any other solutions??
    Can I apply a style to an h:outputText or h:commandlink ?
    thanks

    I would not worry too much about making the page XHTML valid. Having doctype there only says what you consider to be valid it certainly has nothing to do with enforcement.
    you should be able to include your style css and then use
    <h:buttonText styleClass="buttonText"/>
    thats all there is to it.

  • Tiles+JSF exceptions

    Hi!
    When I try to insert a part of JSF into the tiles and when some of JSF tags method or property bindings throws an exceptions, this exception is being handled either by Tiles or by JSF and is rendered on page in place of tag - [ServletException...
    Is there is a way to force an exception to be trhown up to the end?

    did you tried something like this:
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    <%@ taglib prefix="t" uri="/WEB-INF/struts-tiles.tld" %>
    <f:view>
    <f:loadBundle basename="net.sourceforge.myfaces.tiles.example.Messages" var="messages"/>
        <body>
          <table border="1" width="100%" cellspacing="5">
            <tr>
              <th colspan="2" align="center">
                <f:subview id="header">
                  <t:insert attribute="header" flush="false"/>
                </f:subview>
              </th>
            </tr>
            <tr height="420">
              <td width="140" valign="top">
                <f:subview id="menu">
                  <t:insert attribute="menu" flush="false"/>
                </f:subview>
              </td>
              <td align="left" valign="top">
                <f:subview id="body">
                  <t:insert attribute="body" flush="false"/>
                </f:subview>
              </td>
            </tr>
            <tr>
              <td colspan="2" align="center">
                <f:subview id="footer">
                  <t:insert attribute="footer" flush="false"/>
                </f:subview>
              </td>
            </tr>
          </table>
        </body>
      </s:html>
    </f:view>

  • Problems with JSF and included subviews

    Hi everybody,
    I' ve got a problem with JSF and included subviews which makes me going
    crazy. I've got no clue why my web-pages are represent wrongly. The only
    tip I've got is that it must be connected with the kind I do include my JSF-pages.
    When I use <%@file="sub.jsp"%> my pages are are represent right. When I use <jsp:include page="Sub.jsp" /> or <c:import url="Sub.jsp" /> ( mark: the usage of flush="true" or flush="false" doesn't matter )
    my pages are represent wrongly.
    The usage of tags like f:facet or f:verbatim were also included but didn't point to an solution.
    I searched the whole Sun Developer Forum and some other web-sites for any solution for my problem but the given hints and clues didn't help. Now I'm trying to post my problem directly in Sun's Forum in hope to get help.
    My environment is the following:
    JAVA JDK 1.5 Update 4
    Tomcat 5.5.9
    JSLT 1.1
    Sun JSF 1.1
    Win 2K
    Here's my code:
    Main.jsp
    <%@ page language="java"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%
              String path = request.getContextPath();
              String basePath = request.getScheme() + "://" + request.getServerName()
                        + ":" + request.getServerPort() + path + "/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
         <base href="<%=basePath%>">
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">   
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <link rel="stylesheet" href="stil.jsp" type="text/css" />
    </head>
    <body>
         <f:view>
              <h:form>
                   <div class="table">
                        <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 1"/>
                             <h:outputText styleClass="tdinfo" value="value 2"/>
                        </div>
                        <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 3"/>
                             <h:outputText styleClass="tdinfo" value="value 4"/>
                        </div>
                   </div>
              </h:form>     
              <jsp:include page="Sub.jsp" />
         </f:view>
    </body>
    </html>Sub.jsp
    <%@ page language="java"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <f:subview id="subview">
         <h:form>
              <div class="table">
                   <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 11"/>
                             <h:outputText styleClass="tdinfo" value="value 22"/>
                   </div>
                   <div class="tr">
                        <h:outputText styleClass="tdleft" value="value 33"/>
                        <h:outputText styleClass="tdinfo" value="value 44"/>
                   </div>
              </div>
         </h:form>
    </f:subview>stil.jsp
    <%@page contentType="text/css"%>
    <%
        String  schwarz     = "#000000",
                grau1       = "#707070",
                grau2       = "#c0c0c0",
                grau3       = "#e0e0e0",
                grau4       = "#e8e8e8",
                grau5       = "#fdfdfd",
                blau        = "#0000dd",
                tuerkis     = "#00cfff";
        String  liniendicke = "1px",
                linienart   = "solid";
        String allgemeineTextFarbe           = schwarz;
        String allgemeineHintergrundFarbe    = grau3;
        String infoTextFarbe                 = blau;
        String fieldsetRandFarbe             = blau;
        String fieldsetRandDicke             = liniendicke;
        String fieldsetRandArt               = linienart;
        String hrLinienFarbe                 = blau;
        String hrLinienDicke                 = liniendicke;
        String hrLinienArt                   = linienart;
        String inputAktivHintergrundFarbe    = grau5;
        String inputReadonlyHintergrundFarbe = grau4;
        String inputPassivHintergrundFarbe   = grau4;
        String inputPassivFarbe              = schwarz;
        String inputRandFarbe1               = grau1;
        String inputRandFarbe2               = grau5;
        String inputRandDicke                = liniendicke;
        String inputRandArt                  = linienart;
        String inputButtonHintergrundFarbe   = grau3;
        String legendenFarbe                 = blau;
        String linkFarbe                     = blau;
        String linkAktivFarbe                = tuerkis;
        String linkBesuchtFarbe              = blau;
        String linkFocusFarbe                = tuerkis;
        String objectGitterFarbe             = grau5;
        String objectGitterDicke             = liniendicke;
        String objectGitterArt               = linienart;
        String tabellenGitterFarbe           = grau5;
        String tabellenGitterDicke           = liniendicke;
        String tabellenGitterArt             = linienart;
    %>
    <%-- ----------------------------------------------- --%>
    <%-- Textdarstellung mittels der Display-Eigenschaft --%>
    <%-- in den Tags div und span                        --%>
    <%-- ----------------------------------------------- --%>
    *.table {
        display:table;
        border-collapse:collapse;
    *.tbody {
        display:table-row-group;
    *.tr {
        display:table-row;
    *.td,*.tdright,*.tdleft,*.tdinfo,*.th {
        display:table-cell;
        padding:3px;
        vertical-align:middle;
    *.td,*.th {
        text-align:center;
    *.tdright {
        text-align:right;
    *.tdleft {
        text-align:left;
    *.tdinfo {
        color:<%=infoTextFarbe%>;
        text-align:right;
    *.th {
        color:<%=infoTextFarbe%>;
        font-weight:bold;
    }thanks in advance
    benjamin

    Hello Zhong Li,
    many thanks for your post, but it didn't work.
    My problem is that the JSF-Components im my included or imported
    JSP-Pages does not accept any kind of style or styleClass for
    designing. The components take over the informations for colors
    but not for alignment.
    When I take a look at the generated JAVA-Source in $TOMCAT/WORK/WEBAPP for my sub.jsp ( sub.java )
    it seems that the resulting HTML-page would be presented correctly.
    But later when I start the application via Firefox or Mozilla the html-sourcecode is totally wrong.
    In my example I create a simple grid with 2 rows and 2 columns.
    Both columns contains JSF-Outtext-Components and are included with div-tags.
    The generated Sub.java shows that the text would be setted in the div-tags. Unfortunately the html-sourcecode represented by my browser shows that jsf-text is not setted in the tags but in the <h:form> tags. The div-tags are neither rounded by <h:form> nor containing the JSF-OutText-Components.
    Any clue?
    Many thanks Benjamin
    Here is the html-code from Firefox:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
         <base href="http://polaris21:8080/webtest/">
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">   
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <link rel="stylesheet" href="stil.jsp" type="text/css" />
    </head>
    <body>
         <form id="_id0" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
              <div class="table">
                   <div class="tr">
                        <span class="tdleft">value 1</span>
                        <span class="tdinfo">value 2</span>
                   </div>
                   <div class="tr">
                        <span class="tdleft">value 3</span>
                        <span class="tdinfo">value 4</span>
                   </div>
              </div>
              <input type="hidden" name="_id0" value="_id0" />
         </form>     
          <form id="SUB:_id5" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
               <span class="tdleft">value 11</span>
              <span class="tdinfo">value 22</span>
              <span class="tdleft">value 33</span>
              <span class="tdinfo">value 44</span>
              <input type="hidden" name="SUB:_id5" value="SUB:_id5" />
         </form>
         <div class="table">
              <div class="tr">
              </div>
              <div class="tr">
              </div>
         </div>
    </body>
    </html>

  • PL/SQL Server Pages (PSPs) and CSS

    Hi,
    I am used to creating standards compliant websites using XHTML and CSS and some other application language for dynamic content. I have recently started working with PL/SQL and want to create an application using PSPs. I was wondering the best way to go about including CSS in an application, because it doesn't make sense to duplication the CSS on each page, but since the PSP is converted to a procedure this seesm to be the only way to include CSS?
    Any ideas on best practice for using CSS with PSPs?

    I think you should be able to put all your CSS into a single file, or only a few files, like in a normal web project and that you can include this file using the regular HTML tag.
    You store your CSS file(s) in a folder that is accessible by your website. Normally this is achieved by adding an Alias in the Apache webserver that is embedded in the Oracle database.
    If I remember it correctly (it has been a while since I saw the embedded webserver) your request for your PSP goes to an url like http://your.server.com/pls/your_page. Everything of the url that comes after /pls/ is handled by the mod_plsql Apache module that is repsonsible for sending the request to the database and returning the result to the screen.
    If you can define an alias like 'css' (without the quotes), which makes the url something like http://your.server.com/css/, then you can try to include your CSS file(s) referring to /css/file.css. Once you get this working, you can do the same for images.
    This is a generic approach that can get you started hopefully.
    Good luck.
    I hope this can get you started. Information on the alias can be found

  • Building a Simple JSF and Web Services App in JDeveloper 10.1.3 Preview

    Hi
    I was trying out this example of JSF and webservices at:
    http://www.oracle.com/technology/products/jdev/101/howtos/jsfws/index.html
    Has anyone tried it before? I'm getting the following error:
    calling http://216.200.21.157:9090/soap
    WARNING: Unable to connect to URL: http://216.200.21.157:9090/soap due to java.security.PrivilegedActionException: oracle.j2ee.ws.saaj.ContentTypeException: Not a valid SOAP Content-Type: text/html
    java.rmi.RemoteException: ; nested exception is:
         HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: oracle.j2ee.ws.saaj.ContentTypeException: Not a valid SOAP Content-Type: text/html
         at com.minc.ws.stockquery.proxy.runtime.NetXmethodsServicesStockquoteStockQuoteBinding_Stub.getQuote(NetXmethodsServicesStockquoteStockQuoteBinding_Stub.java:96)
         at com.minc.ws.stockquery.proxy.NetXmethodsServicesStockquoteStockQuotePortClient.getQuote(NetXmethodsServicesStockquoteStockQuotePortClient.java:40)
         at com.minc.ws.stockquery.proxy.NetXmethodsServicesStockquoteStockQuotePortClient.main(NetXmethodsServicesStockquoteStockQuotePortClient.java:29)
    Caused by: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: oracle.j2ee.ws.saaj.ContentTypeException: Not a valid SOAP Content-Type: text/html
         at oracle.j2ee.ws.client.http.HttpClientTransport.invokeImpl(HttpClientTransport.java:142)
         at oracle.j2ee.ws.client.http.HttpClientTransport.invoke(HttpClientTransport.java:118)
         at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:175)
         at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:112)
         at com.minc.ws.stockquery.proxy.runtime.NetXmethodsServicesStockquoteStockQuoteBinding_Stub.getQuote(NetXmethodsServicesStockquoteStockQuoteBinding_Stub.java:79)
         ... 2 more
    Any ideas?
    Thanks
    Alex

    I'm not using 10.1.3 preview. I was using 10.1.3.1 production. I just copied the title of the tutorial as my subject. sorry for the confusion!! :)
    I used the HTTP analyzer and this is what I got in the header:
    <HTML><HEAD><TITLE>TCP Packet Monitor Error</TITLE></HEAD><BODY>JDeveloper TCP Packet Monitor encountered an error retrieving<P><pre>POST http://216.200.21.157:9090/soap HTTP/1.1
    Host: 216.200.21.157:9090
    Proxy-Connection: Keep-Alive
    Connection: TE
    TE: trailers, deflate, gzip, compress
    User-Agent: Oracle HTTPClient Version 10h
    SOAPAction: "urn:xmethods-delayed-quotes#getQuote"
    Accept-Encoding: gzip, x-gzip, compress, x-compress
    Content-type: text/xml; charset=UTF-8
    Content-length: 680
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="urn:xmethods-delayed-quotes"><env:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" env:mustUnderstand="1"/></env:Header><env:Body><ns0:getQuote env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><symbol xsi:type="xsd:string">orcl</symbol></ns0:getQuote></env:Body></env:Envelope></pre><P>The error was :<P><pre>IOException retrieving the response: java.net.ConnectException: Connection refused: connect</pre><P></HTML>
    It looks like I'm getting connection refused error... Hmmm.. wonder why?
    I'll download 10.1.3.2 and see if that helps..
    Thanks for looking into this!
    Alex

  • Custom html and css broken in BC

    I have created some content in iWeb. A photo gallery that doesn't work when uploaded to BC.
    It works fine when I upload to a different Host.
    http://isodisc.businesscatalyst.com/usbcat/ISODISC_Full_USB_Flash_Catalog.html

    I'm building my website in Muse, using a few Adobe typeKit fonts - Open Sans and Bebas Neue. There's plenty of code and css developed when I export the muse file QUESTION: Will Contribute maintain my font choice integrity? Or do I play it safe with standard web-safe choices?

Maybe you are looking for

  • Argentina Down Payment for Clearing (F-30) requires Tax code

    HI All, I have some problem with F-30 with Argentina Down payment clearing. The customer in Argentina has encountered the error during executing T- code :F-30 Error message =>"Tax entry not possible in this item" Message no. FF724 As checked, The err

  • Have an Airport hooked up to a Cable modem, gives wireless access to 1 laptop but on to anything else

    I have an Airport hooked up to a Cable modem. Give wireless access to my MAC Book Pro, connects to my Ipad but will not have internet access, tried a different Airport with the same results. Please help.

  • FCP 5 & Motion2 question

    Hi All, hope this question isn't a silly one. When I go to the send to (motion) option in FCP the media goes off-line, once I am in Motion I get asked the question to reconnect, however the name of the file it asks for is not the exact same one I am

  • Spry Data Set error in IE8

    I'm creating a page that uses a Spry Data Set for a book I'm working on. I have no problem with the data set when viewing the page in IE9 beta and Safari. Two separate testers who are using IE8 get the same error: "type="MM_SPRY_DATA_REFERENCE" ....

  • IPhoto '06 crashes when rebuilding thumbnail cache

    title says it all. Every time I try to rebuild the cache when it prompts me to, it crashes about 90% thru. Any ideas?