Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



JKsf and xhtml

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 21-07-2010
Member
 
Join Date: Apr 2010
Posts: 30
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 .

Reply With Quote
  #2  
Old 21-07-2010
Member
 
Join Date: May 2008
Posts: 663
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.
Reply With Quote
  #3  
Old 21-07-2010
Member
 
Join Date: Apr 2010
Posts: 30
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 java.net 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 .
Reply With Quote
  #4  
Old 21-07-2010
Member
 
Join Date: Apr 2010
Posts: 18
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 .
Reply With Quote
  #5  
Old 21-07-2010
Member
 
Join Date: Apr 2010
Posts: 29
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 :

Code:
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:jsp="http://java.sun.com/JSP/Page"
    version="2.0">
  <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"
                      session="false" />
  <jsp:output doctype-public="-//W3C//DTD XHTML 1.1//EN"
              doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
              doctype-root-element="html" omit-xml-declaration="false" />
  <f:view>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head><title>title</title></head>
    <body>
    <h:form><p>text</p></h:form>
    </body></html>
  </f:view>
</jsp:root>
And the result that I am getting from this code :

Code:
<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"><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>
Reply With Quote
  #6  
Old 23-07-2010
Member
 
Join Date: Apr 2008
Posts: 446
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 02:45 AM.