Re: Problems with Taglibs



"gwoodho...@xxxxxxxxx" wrote:
I'm getting this error:
javax.servlet.ServletException: javax.servlet.jsp.JspException:
Content is not allowed in prolog.

I have: "WEB-INF\lib\standard-1.1.2-patched.jar" in my buildpath.

The part of the code its having trouble with is in my very first page
with this:
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp" %>

which links to taglibs.jsp:

GArlington wrote:
I think that the following line(s) may be causing your problem:

<%@ page contentType="text/html;charset=UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>

You may be trying to reset the page headers after some output is
already written, it does not usually work...

I do not understand how those lines reset page headers after output is already written. How is it that they do that?

Just about every JSP I've written for the last seven years begins with
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
(quoted from my current project verbatim)

Not a one has the error the OP described.

--
Lew
.



Relevant Pages

  • JSP with Inner class
    ... I am trying to create a JSP that has a class in it. ... function) I am having a lot of trouble getting it to work though. ... db2, String command, String results) { ...
    (comp.lang.java.programmer)
  • Re: GNU prolog is not so reliable as SWI-prolog
    ... I have ever use the PDC prolog 3.31. ... In Turbo Prolog, repeat can be coded as the following: ... That's a trouble for me. ... You'll get really in trouble here and there if you insist that only the syntax of the vintage compiler you are used to is satisfactory... ...
    (comp.lang.prolog)
  • Re: Studio Creator and Applets
    ... website do ... ... Was all that just to explain that you have trouble putting an ... applet tag into an jsp page when you are using Java Studio Creator? ...
    (comp.lang.java.programmer)
  • Re: tomcat error..
    ... perhaps looking for some file to compile or was having trouble with ... JSP. ... Try looking in the code that had trouble to ... Roedy Green, Canadian Mind Products ...
    (comp.lang.java.help)
  • cannot see jsp pages
    ... After I update my Windows Xp with service pack 2, I have problem opening ... *.jsp pages....what can I do to solve the trouble? ...
    (microsoft.public.windows.inetexplorer.ie6.browser)