Results 1 to 6 of 6

Thread: JKsf and xhtml

  1. #1
    Join Date
    Apr 2010

    JKsf and xhtml

    Hi everyone,
    I am having some issue and need to discuss a quick question, please hep me out to resolve issues : Do you have any method to make jsf render as valid xhtml (or, failing that, as valid html)? A frequent search on the google evaluated up nothing. Or is there another third party renderer that does the same ? Please help me out ..

    Thanks .

  2. #2
    Join Date
    May 2008

    Re: JKsf and xhtml

    All of things are rendered by the Faces standard renderkit conforms to the below suggested XHTML practices:

    • XHTML elements should be completely nested
    • XHTML documents should be formatted in well manner
    • Tag names must be in lowercase
    • Entire XHTML components must be closed
    • Attribute names must be in lower case
    • Attribute values should be quoted
    • Attribute minimization is forbidden
    • The Identity attribute overwrite the name of attribute.

  3. #3
    Join Date
    Apr 2010

    Re: JKsf and xhtml

    I have been moving via the supplied demonstration . Commonly , I quite need to drop the pages that I have generated within the w3c validator at the site , which is where this came up. If I occupy a page with otherwise validates as xhtml transitional and associate :

    <h:inputText id="y" value="#{Bean001.y}" validator="#{Bean001.validate}" />

    I get out:

    <input id="helloForm:y" type="text" name="helloForm:y" value="">

    Such type of tag is not closed, and so the validator ignores the page. I had a quick touch at the jsf code drop on the website and (Although I haven't executed this ) that code does looks to close entire tags (method endElement in HtmlResponseWriter). The only different, very minor and thing that I have got the validator objecting to was not running with the 'type="XX"' attributes in <script> tags .

  4. #4
    Join Date
    Apr 2010

    Re: JKsf and xhtml

    I am not convinced of the method of presenting "some XHTML practices" which is the default renderkit adheres to, as opposed to actually defining that it adheres to the standard. Specifically , JSF doesn't attempt to skip & (ampersand) characters that is generated into the attributes, in URLs - I have figured out that MyFaces does not perform this either. It could be received by alteration of the ResponseWriterImpl. I know that "proper" XML escaping could fine cause the final URLs to become undetectable within the non-XHTML-aware browsers, but I am disappointed there assumes as to be small discussion of this very necessary problem .

  5. #5
    Join Date
    Apr 2010

    Re: JKsf and xhtml

    I am going to show you the ouput produced by the JSF which is actually doesn't assumes to be the valid XHTML , just take a look at the following code snippet :

    <?xml version="1.0" encoding="UTF-8"?>
      < contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"
                          session="false" />
      <jsp:output doctype-public="-//W3C//DTD XHTML 1.1//EN"
                  doctype-root-element="html" omit-xml-declaration="false" />
        <html xmlns="">
    And the result that I am getting from this code :

    <?xml version="1.0" encoding="UTF-8"?> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" ""> 
    <html xmlns=""><head><title>title</title></head><body><form id="_id0" method="post" action="/index.faces;jsessionid=472A9F3A62261173DFFEB6046A0ECBD1" enctype="application/x-www-form-urlencoded"> 
    <p>text</p><input type="hidden" name="_id0" value="_id0" /></form></body></html>

  6. #6
    Join Date
    Apr 2008

    Re: JKsf and xhtml

    I have tried to consider about the exact same thing. When you refer the official W3C validator, <input> elements (including hidden ones) unable to move directly within a <form> element without being embedded according to the formatting components like <p>, <h3>, <td>.

    It will cause JSF pages to always got failed (slightly) validation. This is with Sun JSF 1.1_01.

    I am sure that it is not an error on my section.
    - Misunderstanding on Sun's section of XHTML specification.
    - Latest configuration to XHTML.
    - This is resolved in the latest versions of JSF (1.2) that Sun is working on that

Similar Threads

  1. Don't know about the advantages of XHTML
    By Sarfaraj Khan in forum Software Development
    Replies: 5
    Last Post: 30-01-2010, 12:43 PM
  2. How to Host an XHTML Website with a FTP?
    By hatred in forum Software Development
    Replies: 5
    Last Post: 06-01-2010, 06:49 PM
  3. Difference between dhtml, xhtml and xml
    By Sacchidananda in forum Software Development
    Replies: 3
    Last Post: 16-11-2009, 06:44 AM
  4. How to use List in XHTML
    By Gyan Guru in forum Guides & Tutorials
    Replies: 2
    Last Post: 03-07-2009, 02:14 PM
  5. Differences between XHTML and PHP
    By JTD in forum Software Development
    Replies: 1
    Last Post: 22-11-2008, 01:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts