1

I have just started experimenting with JSPX and ICEfaces for a work project. I would like to know the best standards used to work with .JSPX and the best way to minimize code from pages.

I had worked with PHP, asp.NET, and Java before so you get an idea of my background.

I have some issues:

First of all, does JSPX use some kind of Master Page, if not I guess using "include" would be the best way to reduce repeated code. However I still cannot get rid of the whole header because I need the Title tag, unless this has a way around!?

The second issue is, that the html dumped by JSP is sometimes not valid. For example this is the html declaration: <html id="document:html" lang="en"> which is not valid, and there are other similar issues. I know there is another post about this on Stack Overflow, but that targets mainly self closing tags, doesn't mention the doctype issue.

I would appreciate if you can help me with my current issues, and if you have some good tutorials please share. What I would like is to create maintainable code and reduce code in pages as much as possible (for example include header and footer files, so you only have those in 1 file).

Update (BalusC Comment):

These are the first three lines I have in my .jspx file:

<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ice="http://www.icesoft.com/icefaces/component">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
Ryan S
  • 3,210
  • 17
  • 48
  • 79
  • Is there any specific reason that you prefer the legacy JSPX over its successor Facelets? In any way, for Facelets you can read a similar question here: http://stackoverflow.com/questions/6822000/when-to-use-uiinclude-tag-files-composite-components-and-or-custom-componen – BalusC Jan 20 '12 at 12:11
  • @BalusC - Yes, the reason is because of work. They are using JSPX and ICEfaces here. – Ryan S Jan 20 '12 at 12:19
  • Well, as to the doctype issue, I'd suggest using HTML5 doctype ` `. – BalusC Jan 20 '12 at 12:28
  • @BalusC - The problem is that I do not have the header in my .jspx file. Please look at the update in the description. – Ryan S Jan 20 '12 at 12:46

0 Answers0