JSF and semantic HTML.

I am web designer developing with web standards and semantic html. I've worked with struts before, with it I had easy control over the tag soup sent to the client, it was easy to markup using semantic html/xhtml. With jsf I have less much control over the markup. Is there anyone developing semantic html markup using jsf? Any good solutions to achieve it?

Take a look at facelets:
https://facelets.dev.java.net/

Similar Messages

  • JSF tags and produced html

    Hi all i have a question. Why do the JSF tags produce html that is laid out with tables rather than divs? I've tried to get the jsf framework adopted in my organisation and its this, and i quote 'Poor html' that is blocking the adoption.
    Any one got a good answer i can take to the CTO please?
    The only thing i could come up with was cross browser compatibility.

    The CTO is about ten years out of date if he is allergic to HTML tables. Everybody does it except wannabe HTML gurus who invented this 'issue'. It might have been a problem once. Not now.

  • 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

  • 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!

  • 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.

  • JSP, JSF, and ADF

    I've just started playing around with this and was looking for samples/tutorials to help. Of the tutorials/samples I've seen, they appear to fall short of explaining an end-end example and stick mostly to JSF and the backing bean - usually displaying static data within a JSP and navigation. I'm a bit confused on how to call custom methods in my business services (application modules) and in turn use the view objects to fetch data from my database and display the results within a JSP using the JSF components.
    I realize the latest preview JDeveloper is without ADF but while I had time I was hoping to play around with ADF Faces to hit my development database. Guess I'm trying to make sense of how JSP, JSF, Business components, and my db connection all play together in order to set up a decent starting point for an app.

    You could use Jdeveloper 10G and play around with ADF Faces, look at the demos, and the sources behind them.
    There are a couple of papers on OTN like...
    Working with ADF Faces in JDev 10g:
    http://www.oracle.com/technology/products/jdev/howtos/10g/adfjsf/how-to-adf-faces-10gjdev.htm
    Roadmap for ADF Faces:
    http://www.oracle.com/technology/products/jdev/collateral/papers/9.0.5.0/adfuix_roadmap/adfuix_roadmap.html
    And many more... as I could find upon search...
    http://www.oracle.com/ultrasearch/wwws_otn/searchotn.jsp?p_Action=Search&p_Query=adf+faces
    The visual editing support for 'The ADF Model access through ADF Faces bindings' is under development (hence no tutorials), and will be available in future release (could be post 10G release).
    -Udupa

  • JSF and Character Sets (UTF-8)

    Hi all,
    This question might have been asked before, but I'm going to ask it anyway because I'm completely puzzled by how this works in JSF.
    Let's begin with the basics, I have an application running on an OC4J servlet container, and am using JSF 1.1 (MyFaces). The problems I am having with this setup, is that it seems that the character encodings I want the server/client to use are not coming across correctly. I'm trying to enforce the application to be UTF-8, but after the response is rendered to my client, I've magically been reverted to ISO-8859-1, which is the main character set for the netherlands. However, I'm building the application to support proper internationalization; which means I NEED to use UTF-8.
    I've executed the following steps to reach this goal:
    - All JSP files contain page directives, noting the character set:
    <%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>I've checked the generated source that comes from the JSP's, it looks as expected.
    - I've created a servlet filter to set the character set directly on the request and response objects:
        public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
            // Set the characterencoding for the request and response streams.
            req.setCharacterEncoding("UTF-8");
            res.setContentType("text/html; charset=UTF-8");       
            // Complete (continue) the processing chain.
            chain.doFilter(req, res); 
        }I've debugged the code, and this works fine, except for where JSF comes in. If I use the above situation, without going through JSF, my pages come back UTF-8. When I go through JSF, my pages come back as ISO-8859-1. I'm baffled as to what is causing this. On several forums, writing a filter was proposed as the solution, however this doesn't do it for me.
    It looks like somewhere internally in JSF the character set is changed to ISO. I've been through the sources, and I've found several pieces of code that support that theory. I've seen portions of code where the character set for the response is set to that of the request. Which in my case coming from a dutch system, will be ISO.
    How can this be prevented? Can anyone give some good insight on the inner workings of JSF with regards to character sets in specific? Could this be a servlet container problem?
    Many thanks in advance for your assistance,
    Jarno

    Jarno,
    I've been investigating JSF and character encodings a bit this weekend. And I have to say it's more than a little confusing. But I may have a little insight as to what's going on here.
    I have a post here:
    http://forum.java.sun.com/thread.jspa?threadID=725929&tstart=45
    where I have a number of open questions regarding JSF 1.2's intended handling of character encodings. Please feel free to comment, as you're clearly struggling with some of the same questions I have.
    In MyFaces JSF 1.1 and JSF-RI 1.2 the handling appears to be dependent on the raw Content-Type header. Looking at the MyFaces implementation here -
    http://svn.apache.org/repos/asf/myfaces/legacy/tags/JSF_1_1_started/src/myfaces/org/apache/myfaces/application/jsp/JspViewHandlerImpl.java
    (which I'm not sure is the correct code, but it's the best I've found) it looks like the raw header Content-Type header is being parsed in handleCharacterEncoding. The resulting value (if not null) is used to set the request character encoding.
    The JSF-RI 1.2 code is similar - calculateCharacterEncoding(FacesContext) in ViewHandler appears to parse the raw header, as opposed to using the CharacterEncoding getter on ServletRequest. This is understandable, as this code should be able to handle PortletRequests as well as ServletRequests. And PortletRequests don't have set/getCharacterEncoding methods.
    My first thought is that calling setCharacterEncoding on the request in the filter may not update the raw Content-Type header. (I haven't checked if this is the case) If it doesn't, then the raw header may be getting reparsed and the request encoding getting reset in the ViewHandler. I'd suggest that you check the state of the Content-Type header before and after your call to req.setCharacterEncoding('UTF-8"). If the header charset value is unset or unchanged after this call, you may want to update it manually in your Filter.
    If that doesn't work, I'd suggest writing a simple ViewHandler which prints out the request's character encoding and the value of the Content-Type header to your logs before and after the calls to the underlying ViewHandler for each major method (i.e. renderView, etc.)
    Not sure if that's helpful, but it's my best advice based on the understanding I've reached to date. And I definitely agree - documentation on this point appears to be lacking. Good luck
    Regards,
    Peter

  • Jsf and Seam

    Hi,
    I have a JSF project and would like to add a Captcha on the new user page.
    I see several examples with Seam.
    http://www.digitalsanctuary.com/tech-blog/java/jboss/seam/captcha-with-seam-in-three-minutes.html
    http://thelabdude.blogspot.com/2009/05/user-registration-solution-using-jboss.html
    1) What do I need to add Seam to my app? Is it worth it from Captcha?
    http://livedemo.exadel.com/richfaces-demo/richfaces/paint2D.jsf?s=glassX
    I copied this into my app to test and get several errors. I did not see the problem?
    I see a NullPointer error..but dont know where to set it.
    SEVERE: Servlet.service() for servlet Faces Servlet threw exception
    javax.faces.FacesException: Error send image
            at org.richfaces.renderkit.html.Paint2DResource.send(Paint2DResource.java:192)
            at org.ajax4jsf.resource.ResourceLifecycle.sendResource(ResourceLifecycle.java:221)
            at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:146)
            at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:225)
            at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
            at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:496)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            at java.lang.Thread.run(Unknown Source)
    Caused by: javax.faces.el.EvaluationException: org.apache.jasper.el.JspELException: /loginTest.jsp(62,2) '#{paintBean.paint}' java.lang.NullPointerException
            at org.richfaces.webapp.taglib.MethodBindingMethodExpressionAdaptor.invoke(MethodBindingMethodExpressionAdaptor.java:56)
            at org.richfaces.renderkit.html.Paint2DResource.send(Paint2DResource.java:182)
            ... 17 more
    Caused by: org.apache.jasper.el.JspELException: /loginTest.jsp(62,2) '#{paintBean.paint}' java.lang.NullPointerException
            at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:77)
            at org.richfaces.webapp.taglib.MethodBindingMethodExpressionAdaptor.invoke(MethodBindingMethodExpressionAdaptor.java:52)
            ... 18 more
    Caused by: java.lang.NullPointerException
            at com.netfixup.java.PaintBean.paint(Unknown Source)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)Anyone out there have and easy quick way to do Captcha with just JSF ? or should I go with Seam?
    Thanks
    Phil
    Edited by: nohacks on Aug 20, 2009 4:08 AM

    Going to seam might not be the answer to your problems. For one seam is not easy to get running on anything but a JBoss server (it is possible, but not easy). Secondly Seam is aimed at bringing JSF and EJBs closer together, among other things. Since you are running on Tomcat, I don't think you are using EJBs and therefore the use of Seam degrades greatly.
    The root of the problem is easy enough to spot:
    /loginTest.jsp(62,2) '#{paintBean.paint}'So what is this paintBean doing? If you have access to the code, you could check out the method that gives the error:
    com.netfixup.java.PaintBean.paintto try and figure out what is null. SOMETHING is apparently not initialized properly, but unless the server logs can give you a hint what that something is, it is hard to help you further.

  • JSF and JDBC

    Hi, I am new to JSF, can anybody direct me to a good tutorial on JSF and JDBC (Oracle)?
    Thanks

    Try
    http://java.sun.com/developer/onlineTraining/index.html
    From here you will find links for JDBC (via Distributed computing) & the Web Services Tutorial (JSF is included)
    If you specifically want Oracle then you can sign up to OTN - try
    http://www.oracle.com/technologies/

  • 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>

  • JSF and Facelets on OC4J 10.1.2 / 10.1.3_dp4

    Hi,
    I am developing a web application using JSF and it works properly on OPC4J (JSF RI and myFaces). But I cannot find a way to get Facelets running.
    When I simply deploy the sample application from exadel here I get strange errors:
    1) Using JSP 2.4
    java.io.IOException: code-source:/D:/dev/Server/oc4j_10.1.3_dp4/j2ee/home/applications/JSF/JSF63622/WEB-INF/lib/xhtml-lat1.ent has no "!<path>" suffix so does not name a path within the code-source.
         at oracle.oc4j.loader.SharedCodeSourceSet.getResourceStream(SharedCodeSourceSet.java:396)
         at oracle.oc4j.loader.SharedCodeSourceURL$Connection.getInputStream(SharedCodeSourceURL.java:93)
         at java.net.URL.openStream(URL.java:1007)
         at oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2367)
         at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:280)
         at oracle.xml.parser.v2.XMLReader.pushEntityRef(XMLReader.java:2240)
         at oracle.xml.parser.v2.XMLReader.pushEntityRef(XMLReader.java:2168)
         at oracle.xml.parser.v2.XMLExternalReader.pushEntityRef(XMLExternalReader.java:157)
         at oracle.xml.parser.v2.XMLExternalReader.checkEntityStart(XMLExternalReader.java:167)
         at oracle.xml.parser.v2.XMLExternalReader.setMarkupDepth(XMLExternalReader.java:285)
         at oracle.xml.parser.v2.NonValidatingParser.parseMarkupDecl(NonValidatingParser.java:617)
         at oracle.xml.parser.v2.NonValidatingParser.parseDoctypeDecl(NonValidatingParser.java:484)
         at oracle.xml.parser.v2.NonValidatingParser.parseProlog(NonValidatingParser.java:310)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:289)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:199)
         at oracle.xml.jaxp.JXSAXParser.parse(JXSAXParser.java:292)
         at oracle.xml.jaxp.JXSAXParser.parse(JXSAXParser.java:230)
         at com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:219)
         at com.sun.facelets.compiler.Compiler.compile(Compiler.java:99)
         at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:187)
         at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:137)
         at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:88)
         at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:396)
         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:434)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:382)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:701)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:397)
         at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:291)
         at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:48)
         at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:225)
         at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:173)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:230)
         at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:305)
         at index2e_jsp._jspService(_index_2e_jsp.java:46)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:408)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:525)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:447)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:382)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:701)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:397)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:833)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:430)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:215)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    2) Using JSP 2.4:
    java.lang.NullPointerException
         at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
         at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:76)
         at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:398)
         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:432)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:382)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:701)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:397)
         at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:291)
         at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:48)
         at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:225)
         at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:173)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:230)
         at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:305)
         at index2e_jsp._jspService(_index_2e_jsp.java:46)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:644)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:364)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:525)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:447)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:382)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:701)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:397)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:833)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:430)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:215)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Has anyone some tips for me why Facelets does not work or how i can get it to work?
    Thanks, Daniel

    Copy the META-INF folder of the
    jsf-facelets.jar to a folder called "config" in the WEB-INF folder of your web and add
    <context-param>
    <param-name>facelets.LIBRARIES</param-name>
    <param-value>/WEB-INF/config/jsf-core.taglib.xml;/WEB-INF/config/jsf-html.taglib.xml;/WEB-INF/config/jsf-ui.taglib.xml;/WEB-INF/config/jstl-core.taglib.xml;/WEB-INF/config/jstl-fn.taglib.xml</param-value>
    </context-param>
    to the web.xml.
    This helped for me.

  • 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.

  • Ejb3 app functions only when both .jsf and .jsp is present

    Hi All,
    I have the following problem: when I try to remove either of booking.jsp and booking.jsf (having same contents) from the directory tree of app.war (following), I get the message HTTP status 404 The requested resource (/s_ejb3_jb421_tobbfele/pages/booking.jsp) is not available.
    Thank you in advance: Balazs Bamer
    JBoss 4.2.1 output:
    16:23:21,101 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
    16:23:21,101 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value true
    16:23:21,101 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.DETECT_JAVASCRIPT' found, using default value false
    16:23:21,101 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.AUTO_SCROLL' found, using default value false
    16:23:21,101 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ADD_RESOURCE_CLASS' found, using default value org.apache.myfaces.renderkit.html.util.DefaultAddResource
    16:23:21,101 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ADD_RESOURCE_CLASS' found, using default value org.apache.myfaces.renderkit.html.util.DefaultAddResource
    16:23:21,121 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.CHECK_EXTENSIONS_FILTER' found, using default value true
    app.war (inside s_ejb3_jb421_tobbfele.ear) contents, with only the booking.jsf:
    META-INF/
    META-INF/MANIFEST.MF
    WEB-INF/
    WEB-INF/web.xml
    WEB-INF/lib/
    WEB-INF/lib/com-sun-rave-designtime.jar
    WEB-INF/lib/commons-beanutils.jar
    WEB-INF/lib/commons-chain.jar
    WEB-INF/lib/commons-codec.jar
    WEB-INF/lib/commons-collections.jar
    WEB-INF/lib/commons-digester.jar
    WEB-INF/lib/commons-el.jar
    WEB-INF/lib/commons-fileupload.jar
    WEB-INF/lib/commons-lang.jar
    WEB-INF/lib/commons-logging.jar
    WEB-INF/lib/commons-validator.jar
    WEB-INF/lib/jakarta-oro.jar
    WEB-INF/lib/jsfcl-dt.jar
    WEB-INF/lib/jsfcl.jar
    WEB-INF/lib/jstl-api.jar
    WEB-INF/lib/jstl-impl.jar
    WEB-INF/lib/openide.jar
    WEB-INF/lib/propertyeditors.jar
    WEB-INF/lib/shale-clay.jar
    WEB-INF/lib/shale-core.jar
    WEB-INF/lib/shale-remoting.jar
    WEB-INF/lib/shale-tiger.jar
    WEB-INF/lib/shale-tiles.jar
    WEB-INF/lib/shale-view-1.0.4.jar
    WEB-INF/lib/tiles-core.jar
    WEB-INF/lib/tomahawk-1.1.2-SNAPSHOT.jar
    WEB-INF/classes/
    WEB-INF/classes/com/
    WEB-INF/classes/com/loxon/
    WEB-INF/classes/com/loxon/shaleproba/
    WEB-INF/classes/com/loxon/shaleproba/FlightServlet.class
    booking_messages.properties
    booking_messages_en.properties
    booking_messages_es.properties
    booking_messages_fr.properties
    images/
    pages/
    theme/
    index.html
    pages/booking.jsf
    theme/style.css
    WEB-INF/faces-config.xml
    index.html:
    <html>
    <head>
      <meta http-equiv="Refresh" content="0; URL=pages/booking.jsf">
    </head>
    </html>faces-config.xml:
    <?xml version="1.0"?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
            <managed-bean>
                    <managed-bean-name>flightServlet</managed-bean-name>
                    <managed-bean-class>com.loxon.shaleproba.FlightServlet</managed-bean-class>
                    <managed-bean-scope>request</managed-bean-scope>
            </managed-bean>
    </faces-config>web.xml:
    <?xml version="1.0"?>
    <web-app   xmlns="http://java.sun.com/xml/ns/j2ee"
                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
                                  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
                          version="2.4">
        <description>debug web.xml</description>
        <context-param>
            <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
            <param-value>client</param-value>
            <description>
                State saving method: "client" or "server" (= default)
                See JSF Specification 2.5.2
            </description>
        </context-param>
        <context-param>
            <param-name>javax.faces.ALLOW_JAVASCRIPT</param-name>
            <param-value>true</param-value>
            <description>
                This parameter tells MyFaces if javascript code should be allowed in the
            </description>
        </context-param>
        <context-param>
            <param-name>javax.faces.DETECT_JAVASCRIPT</param-name>
            <param-value>false</param-value>
        </context-param>
        <context-param>
            <param-name>javax.faces.PRETTY_HTML</param-name>
            <param-value>true</param-value>
            <description>
                If true, rendered HTML code will be formatted, so that it is "human readable".
                i.e. additional line separators and whitespace will be written, that do not
                influence the HTML code.
                Default: "true"
            </description>
        </context-param>
        <context-param>
            <param-name>javax.faces.AUTO_SCROLL</param-name>
            <param-value>true</param-value>
            <description>
                If true, a javascript function will be rendered that is able to restore the
                former vertical scroll on every request. Convenient feature if you have pages
                with long lists and you do not want the browser page to always jump to the top
                if you trigger a link or button action that stays on the same page.
                Default: "false"
            </description>
        </context-param>
        <filter>
            <filter-name>extensionsFilter</filter-name>
            <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
            <init-param>
                <param-name>maxFileSize</param-name>
                <param-value>20m</param-value>
                <description>Set the size limit for uploaded files.
                    Format: 10 - 10 bytes
                            10k - 10 KB
                            10m - 10 MB
                            1g - 1 GB
                </description>
            </init-param>
            <init-param>
                <param-name>uploadThresholdSize</param-name>
                <param-value>100k</param-value>
                <description>Set the threshold size - files
                        below this limit are stored in memory, files above
                        this limit are stored on disk.
                    Format: 10 - 10 bytes
                            10k - 10 KB
                            10m - 10 MB
                            1g - 1 GB
                </description>
            </init-param>
        </filter>
        <filter-mapping>
            <filter-name>extensionsFilter</filter-name>
            <servlet-name>Faces Servlet</servlet-name>
        </filter-mapping>
        <filter-mapping>
            <filter-name>extensionsFilter</filter-name>
            <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
         </filter-mapping>
      <filter>
        <filter-name>shale</filter-name>
        <filter-class>
          org.apache.shale.faces.ShaleApplicationFilter
        </filter-class>
      </filter>
      <filter-mapping>
        <filter-name>shale</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
      </filter-mapping>
        <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>*.jsf</url-pattern>
        </servlet-mapping>
        <welcome-file-list>
            <welcome-file>index.html</welcome-file>
        </welcome-file-list>
    </web-app>booking.jsf:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://struts.apache.org/shale/core" prefix="s" %>
    <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
    <html>
    <head>
      <title>Metro Systems </title>
      <link href="../theme/style.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <div id="container">
    <f:loadBundle basename="booking_messages" var="booking_messages"/>
      <f:view>
          <h3> <h:outputText value="#{booking_messages['welcome']}"/>  </h3>
       <h:form onsubmit="return validateForm(this);">
         <table align="center" cellpadding="5" cellspacing="5">
           <tr>
             <td>Email</td>
             <td><h:inputText id="email" value="#{flightServlet.flight.email}">
                        <s:commonsValidator type="required"
                              arg="Email"
                              server="true"
                              client="true"/>
                        <s:commonsValidator type="email"
                                 arg="#{flightServlet.flight.email}"
                              server="true"
                              client="true"/>
                 </h:inputText>
             </td>
           </tr>
           <tr>
             <td><h:outputText id="departure" value="#{booking_messages['date']}"/></td>
             <td>
                <t:inputCalendar monthYearRowClass="yearMonthHeader" weekRowClass="weekHeader"
                    currentDayCellClass="currentDayCell" value="#{flightServlet.flight.departure}" renderAsPopup="true"
                    popupTodayString="#{booking_messages['popup_today_string']}" popupWeekString="#{booking_messages['popup_week_string']}">
                        <s:commonsValidator type="required"
                              arg="Departure date"
                              server="true"
                              client="true"/>
                 </t:inputCalendar>
            </td>
           </tr>
           <tr>
             <td><h:outputText value="#{booking_messages['city']}"/> </td>
             <td> <h:selectOneMenu value="#{flightServlet.flight.city}" required="true">
                                 <f:selectItem itemLabel="Los Angeles" itemValue="Los Angeles"/>
                                 <f:selectItem itemLabel="Madrid" itemValue="Madrid"/>
                                 <f:selectItem itemLabel="Mexico City" itemValue="Mexico City"/>
                                 <f:selectItem itemLabel="New York" itemValue="New York"/>
                                 <f:selectItem itemLabel="Paris" itemValue="Paris"/>
                </h:selectOneMenu></td>
           </tr>
         </table>
         <h:message for="email" styleClass="errors"/>
         <h:message for="departure" styleClass="errors"/>
         <s:validatorScript functionName="validateForm"/>
         <h:commandButton type="submit" value="#{booking_messages['reserve']}" action="#{flightServlet.reserve}"/>
        <h:messages/>
      </h:form>
      </f:view>
        </div>
    </body>
    </html>ear application.xml:
    <application>
      <display-name>JSF Shale EJB3 JBoss 4.2.1</display-name>
      <module>
        <web>
          <web-uri>app.war</web-uri>
          <context-root>/s_ejb3_jb421_tobbfele</context-root>
        </web>
      </module>
      <module>
        <ejb>app.jar</ejb>
      </module>
    </application>ear jboss-ap.xml:
    <jboss-app>
      <loader-repository>
        s_ejb3_jb421_tobbfele:archive=s_ejb3_jb421_tobbfele.ear
      </loader-repository>
    </jboss-app>

    <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>tells JSF, that it will get accessed via urls which end in jsf. So it's just a logical name
    e.g. index.jsf
    <context-param>
         <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
         <param-value>.jsp</param-value>
    </context-param>Tells JSF that the content filename will end in .jsp
    Default is jsp anyway, so this param is optional.
    Edit:
    http://www.exadel.com/tutorial/jsf/jsftutorial-kickstart.html
    Chapter "Creating the index.jsp File" might help you with the question about processing "jsp only" pages
    Edited by: dube on Oct 26, 2007 2:11 AM

  • Jsf and submit()

    I have the following jsf page.
    <html>
         <%@ taglib uri="http://java.sun.com/jsf/core" prefix ="f" %>
         <%@ taglib uri="http://java.sun.com/jsf/html" prefix ="h" %>
         <f:view>
              <head>
                   <jsp:scriptlet>
                        String path = request.getContextPath() +"/css/styles.css";               
                   </jsp:scriptlet>
                   <link  href ="<jsp:expression>path</jsp:expression>" rel="stylesheet" type="text/css">
                   <f:loadBundle basename="bundle.messages" var="msgs"/>
                   <title><h:outputText value="#{msgs.windowTitleDeletingRows}"/></title>
              </head>
              <body>
                   <h:form>
                        <h:dataTable value="#{tableData.names}" var="name"
                             styleClass="names"
                             headerClass="namesHeader" columnClasses="last, first">
                             <h:column rendered="#{tableData.editable}">
                                  <f:facet name="header">
                                       <h:outputText value="#{msgs.deleteColumnHeader}"/>
                                  </f:facet>
                                  <h:selectBooleanCheckbox value="#{name.markedForDeletion}"
                                       onchange="submit()"/>
                             </h:column>
                             <h:column>
                                  <f:facet name="header">
                                       <h:outputText value="#{msgs.lastColumnHeader}"/>
                                  </f:facet>
                                  <h:outputText value="#{name.last}"/>
                                  <f:verbatim>,</f:verbatim>
                             </h:column>
                             <h:column>
                                  <f:facet name="header">
                                       <h:outputText value="#{msgs.firstColumnHeader}"/>
                                  </f:facet>
                                  <h:outputText value="#{name.first}"/>
                             </h:column>                         
                        </h:dataTable>
                        <p>
                        <h:outputText value="#{msgs.editPrompt}"/>
                        <h:selectBooleanCheckbox onchange="submit()" value="#{tableData.editable}"/>
                        <h:commandButton value="#{msgs.deleteButtonText}" rendered="#{tableData.editable}"
                             action="#{tableData.deleteNames}" disabled="#{not tableData.anyNamesMarkedForDeletion}"/>
                   </h:form>
              </body>
         </f:view>
    </html>          It contains a number of names that gets them form a bean named TableData. It includes a checkbox that when it is activated a series of checkboxes is diplayed next to the names. So when a user checks a checkbox a button named .delete selected names is activated.
    I've taken this example from a tutorial. I want to ask two questions.
    1.In this line :
    <h:selectBooleanCheckbox onchange="submit()" value="#{tableData.editable}"/> how the page understands that is should be submitted in the TableData bean? I mean I have nowhere a javascript function submit()
    2.The example works when I remove from the commandButton
    <h:commandButton value="#{msgs.deleteButtonText}" rendered="#{tableData.editable}"
                             action="#{tableData.deleteNames}" disabled="#{not tableData.anyNamesMarkedForDeletion}"/> the rendered attribute. If this attribute is present then the method deleteNames is never invoked.Can someone explain me why is this happening?
    Thanking you in advance

    Not necessarily. A request scoped bean is destroyed at the end of the request. So the request occurs, the server responds, the bean is destroyed. You submit the form, but the request bean is destroyed. It recreates the necessary bean with default values (I'm guessing that rendered defaults to false).
    You'd probably be ok if you moved just the rendered attribute into the session scope.
    To be honest though, I'm not the best person to ask about the intricacies of the request scope. It's frustrated me a number of times as well. I think what happens, is that it doesn't quite work like people expect. The request bean from the page the user was just viewing is already destroyed by the time JSF will allow you to get at it. You know, while you're formulating your response to the input from the page. Which is generally when you need the data in the request scope (to formulate a good response).
    You have to think of it opposite though. It's not, "what is the user telling the server." It's "what is the server telling the user" and you don't care what the user tells the server (cause it doesn't exist anymore). If you want the user to tell the server to do something, you will have to (at least) temporarily put that data in the session.
    That's been my experience at least. I'm totally open to anyone correcting me (in fact, I'd like to hear it).
    CowKing
    Message was edited by:
    IamCowKing

  • Making button and a html site in visual studio community version

    Hi,
    I like to Making button and a html site  in visual studio community version but i dont know how to put the right code in my c# form to perform a action to my new html site i made with visual studio.
    So ik have a button and i added a html site with the "add" options to my form.I want the button to open onclick that site so i can make a html about some info of the button image (tool to use with metal)
    Any one? Sorry i am very new at this and also from the netherlands but i want to  coding in c# great to to learn..
    Many thanks!
    Arend

    Hi Arend,
    Thank you for posting in MSDN forum.
    Since this forum is to discuss: Visual Studio WPF/SL Designer, Visual Studio Guidance
    Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor. Based on your issue, I think that the issue is more related to the programming. So I’m afraid that it is not the correct forum for this issue.
    To help you find the correct forum for this issue, could you please tell
    me which kind of app you want to create? Is it winform app or others?
    If you want to code for a winform app using c# language, I suggest you
    can consult your question on specific
    WinForm forum so that they can share you something for you to start.
    Thanks for your understanding.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for