JDeveloper 11 and ADF - change the page DTD to HTML5 - html

I have an Oracle ADF / WebLogic project built by someone else with JDeveloper 11 (and the integrated WL server).
The problem is that the HTML DTD is outputted as:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
and I want to change it to HTML5 mode, and I don't know how (I'm a front-end developer):
<!doctype html>
The pages start with this:
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1">
....
Has anyone done this in JDev 11? I couldn't find the answer anywhere. Some people say that JDev 12 does it, but I'm not sure if I can import and build the project in v12 without a lot of changes.

Indeed, JDeveloper 12c uses HTML5, so an upgrade it will help.
I am not aware of any way of changing the doc type in ADF, but you can hack it by altering html response using Servlet Filter:
http://docs.oracle.com/javaee/5/tutorial/doc/bnagb.html

Related

how to insert doctype for html5 in icefaces1.8

I've a legacy icefaces1.8 application. There is a template.xhtml used by other .xhtml file. The template.xhtml file that contains
<ice:outputDeclaration
doctypeRoot="HTML"
doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
I want <!DOCTYPE html> but am finding it difficult to do so. Upgrading to a newer version of icefaces is not an option at the moment.
Ok I found the solution
<ice:outputDeclaration
doctypeRoot="HTML"
doctypePublic=""
doctypeSystem="" />
generates <!doctype html>

JSF: Is it possible to use .HTML instead of .XHTML?

When you are developing a JavaServer Faces application, are you bound to develop a web page in XHTML or is it possible to use HTML instead?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core">
The reason why I prefer to develop in HMTL is first and foremost that I am more used to it. And it's easier to implement add-ons like Bootstrap (at least when you are not used to XHTML). If it's possible to use HTML instead, how do I configure the tags get the same result if I used to default setup?

Why XHTML markup does not generate parsing error?

I started learning the basics of HTML and I have studied differences between XHTML and HTML. I have noticed XHTML is much stricter. Consider below markup
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/TR/xhtml1" xml:lang="en" lang="en">
<head>
<title>Every document must have a title</title>
</head>
<body>
<b><p>hey</b></p><br>
</body>
</html>
I have not properly nested the tags and <br> is not properly closed in XHTML but it does not raise any parsing error and when I have saved the file as test.xhtml then it raised parsing error. So how to actually create XHTML files and also how to use XHTML in HTML5? and could anyone explain me that files saved with .xhtml are XHTML files and with .html are treated as HTML files?
Iam using google chrome. I understand the differences but unable to view practically in the browser. Could anyone help me figuring this out.
Most web browsers have XML and HTML parsers. These use different rules.
In general, the rules they follow are:
If the document has one of various XML content-types and the document in in the XHTML name space: Use the XML parser
If the document has a text/html content-type then use the HTML parser
If the document is loaded from a local file and has a .xhtml file extension, then treat it as having the content-type application/xhtml+xml
If the document is loaded from a local file and has a .html file extension, then treat it as having the content-type text/html

Auto created teext when opening new html-page in Expression web

I'm learning to use Expression Web 4.0
When opening a new html-page, the following text is automatically created:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Is this code redundant, is this needed (or demanded by owners), or what?
Bent
The doctype is used to tell the web browser the particular version of html used to create the web page. It's also responsible for triggering a particular browser rendering mode. It is standardized by World Wide Web Consortium (W3C)
check the list of DTD

xampp server and xforms

I try to see a web page with a xform in xampp-server
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:xf="http://www.w3.org/2002/xhtml">
<head>
There is a model of the form
<xf:model>
<xf:instance>
<person>
<fname />
<lname />
</person>
</xf:instance>
<xf:submission id="form1" method="get" action="submit.asp" />
</xf:model>
and there is the real form
<xf:input ref="fname"><xf:label>First Name</xf:label></xf:input><br />
<xf:input ref="lname"><xf:label>Last Name</xf:label></xf:input><br />
<xf:submit submission="form1"><xf:label>Submit</xf:label></xf:submit>
</body>
</html>
How to see the web page instead of xml-code with error message "This XML file does not appear to have any style information associated with it. The document tree is shown below." in browser? Thank you!
Sadly none of the major browsers support XForms directly. In order to see the XForms running in your browser, you'll need an XForms processor.
In your XAMPP server, the best choice is XSLTForms.
Download it from http://sourceforge.net/projects/xsltforms/ and unpack the files in a folder named xsltforms under the same folder where your page resides.
The next step is to modify your XForms to use the processor. Include the following processing instruction just behind the declaration at the top of the page:
<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl" ?>
XSLTForms uses an XSL transformation to convert your XForms into an HTML5 form usable by your browser, with a little help of Javascript to handle the XForms behavior.
You can find more information in the XSLTForms website and the wikibook.