Hello,
I've a newbie to JSP so I apologize if this is an obvious error on my part. I've been banging my head against this problem for a while and I can't seem to figure it out, though. Any help appreciated.
I'm trying to create a web app that so far is pretty basic. The web page will consist of various sections, laid out using <div>s. E.g header, horizontal navigation bar, sidebar, main content, footer, etc. Since each of the divs will always be present (just with different content, depending on what the user is trying to do), I've broken the various pages up into .jsp fragments that I use to build up each page. So for example my 'home.jsp' looks like:
<%@ include file="content_open.jsp" %>
<%@ include file="home_main.jsp" %>
<%@ include file="home_local.jsp" %>
<%@ include file="home_sub.jsp" %>
<%@ include file="navigation.jsp" %>
<%@ include file="content_close.jsp" %>
So for example, 'content_open.jsp' looks like:
<%@ page contentType="text/html" session="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>My title</title>
<style type="text/css" media="screen">
@import url("css/tools.css");
@import url("css/typo.css");
@import url("css/forms.css");
@import url("css/layout-navtop-localleft.css");
@import url("css/layout.css");
</style>
</head>
<body id="page-home">
<div id="page">
<div id="header" class="clearfix">
<div id="branding">
<img src="images/dolphin.png" width="100" height="70" alt="alternate" />
</div><!-- end branding -->
<hr />
</div><!-- end header -->
<div id="content" class="clearfix">
Then 'home_main.jsp' will fill in the <div id="content> div, etc. All this seems to work fine until I added the JSTL taglib line to 'content_open.jsp' (hightlighted in red above). This gives me the following error:
org.apache.jasper.JasperException: <h3>Validation error messages from TagLibraryValidator for c in /home.jsp</h3><p>null: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x0) was found in the CDATA section.</p>
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:74)
org.apache.jasper.compiler.Validator.validateXmlView(Validator.java:1542)
org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1487)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:188)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
The strange thing is that if I create a really micky mouse example to test, everything works. I can't seem to pinpoint exactly what it doesn't like about my slightly more complex example above.
If the other .jsp fragments are needed I can post those too. Just wondering if this is a known issue or if I'm doing something obviously wrong.
Again, any help appreciated.
Bill