JSP inserted some odd spaces and blank lines but nothing else.
That whitespace is by the way trimmable. In Tomcat and clones all you need to do is to set the JspServlet
's init parameter trimSpaces
to true
.
But all libs I've already tried generate awful html mixed with scripts mixed with some additional hidden inputs and styling inside html. These libs also often offer table layout (with different Panel, GridPanel and other components).
If this is your major concern, then just go ahead with the basic JSF implementation. It provides everything you need to start with, if necessary with a little help of Tomahawk for more enhanced components (e.g. tableless radios/checkboxes) and the missing components (e.g. file upload and data list).
This way you can just do the CSS the usual way: completely externalized in a separate file and only using styleClass
in JSF. Do not mingle inline CSS using the style
attribute. If you want to stylize colonseparated JSF client ID's (colon is an illegal identifier in CSS), then you only need to escape it in the selector using a backslash. E.g. #formid\:inputid { background: gray; }
.
Also do not mingle inline scripts using the on*
attribtues. Use jQuery to introduce unobtrusive Javascript. As to the autogenerated Javascripts coming from JSF components, in the basic implementation you will only get this in h:commandLink
which is basically an <a>
element which submits a hidden POST form. As this is semantically/technically/SEO-ically wrong, I wouldn't use it at all. Just use h:commandButton
to submit forms and h:outputLink
to navigate.
As to table designs, since JSF 1.2 you can just write plain HTML in template. You can just use <div>
elements to define positioned content elements. If you're a purist, you can even use JSF's <h:panelGroup layout="block">
to get a HTML <div>
element. There is absolutely no need to use <h:panelGrid>
to position content elements.
I don't know exactly but I think that ASP.NET generates something similar.
It does.
So, the question: is it a new standard of web-development - creating fast and dirty html?
No, you've it in your hands.