Have a simple question. Let's consider the following tag.
<h:inputText id="text" value="#{bean.value}"/>
If it is mistakenly written as follows.
<h:inputText id="text"value="#{bean.value}"/>
Please notice that there is no space between the id
and the value
attributes in this case. This is expected to be a parse error that should occur during parsing of the XHTML file possibly throwing an appropriate exception.
If it were to happen, absolutely nothing exceptional would be reported. No errors/exceptions would be thrown on the server-side. The target web page on the browser would then merely be left blank (white) in its entirely which would also indicate no errors as obvious on the client-side, since parsing of the file happens on the server-side.
Additional Information :
This already happened to me several times on XHTML files having several lines of code even though extreme care is exercised/taken. Mostly happens during copy/pasting which is many a times essential.
If it were to happen, the only way to trace the error was scan the XHTML document manually starting from the first line, all the way down to the last line (or the trace line, if one is caught) possibly scrolling in the middle through a long, ugly horizontal scroll bar on the IDE's GUI too.
Fortunately, I duplicated the same application twice - once using Java EE and again using Spring hereby XHTML code was same in both of the projects. I had been solving this problem as of now, since I began those applications in parallel by copy/pasting the whole XHTML code from one project to another, when it happened and I was unable to trace the line by average attempts. This is not always an alternative.
Can it get to throw an exception, when an XHTML document is mal-formed in this way? Are there someways to make it debuggable/traceable so that one can get rid of manual/tedious/time-consuming/eye-stretching tracing of an XHTML document?
Caused by: javax.faces.view.facelets.FaceletException: Error Parsing /test.xhtml: Error Traced[line: 25] Element type "h:inputText" must be followed by either attribute specifications, ">" or "/>". at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:456)
– Inclinatoryorg.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory
. Tried removing it. Nothing new happened. – Izak