- This topic has 4 replies, 2 voices, and was last updated 17 years, 3 months ago by Riyad Kalla.
-
AuthorPosts
-
Lance DrakeMemberHi MyEclipse folks,
In making a JSP taglib ref – there are two different URIs possible. For JSTL 1.1 it appears that the correct form for the “c” and “x” and “fmt” and “fn” xmlns is:
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
My ECLIPSE PREFERENCES indicate use of JVM 1.5 – and JSTL 1.1. Yet, if I make reference to the TLDs as shown above, I get “Content Not Allowed In Prolog” errors. However, if I change the URIs to be:
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
…the errors go away. ALSO… note that if the “fn” and “fmt” URIs retain the /jsp reference.
Is it possible there is a confusion-factor that has somehow been introduced into my workplace between JSTL 1.0 and JSTL 1.1 ??
If, so – any suggestions about how to identify and resolve what’s going on?
Thanks!
Lance Drake
Lance DrakeMemberAfter pouring thru all of the Eclipse and MyEclipse preferences, I cannot see any place where JSTL 1.0 is referenced.
There IS a list of the jars in support of it – but nowhere is JSTL 1.0 requested/specified.
Nowhere in my code is “…1.2.dtd” referenced
The IDE web-app TLD Prefix and Descriptions list ALL say “JSTL 1.1”
The jsptaglib XDoclet entry identifies jspversion as 2.0 and taglibversion as 1.1
The ERROR looks like this. (NOTE: There is no leftframe_jsp.java:122 because an XSL transform takes place and dynamic code is created in that process.)
22:31:02,877 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception org.xml.sax.SAXParseException: Content is not allowed in prolog. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSource(ParseSupport.java:227) at org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSourceWithFilter(ParseSupport.java:193) at org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseReaderWithFilter(ParseSupport.java:199) at org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseStringWithFilter(ParseSupport.java:206) at org.apache.taglibs.standard.tag.common.xml.ParseSupport.doEndTag(ParseSupport.java:138) at org.apache.jsp.jcm.app.jsp.leftframe_jsp._jspx_meth_x_parse_0(leftframe_jsp.java:122) at org.apache.jsp.jcm.app.jsp.leftframe_jsp._jspService(leftframe_jsp.java:67)
One last thing – the various forum mentions about “Content Not Allowed In Prolog” talk about UTF-16 characters at the beginning of the file. I assure you that is NOT the problem here.
Anyone looking for some good weekend karma – please chime in – I’ve been spinning my wheels for FOUR DAYS on this JSP/XSL problem.
Thanks!
Lance Drake
Lance DrakeMemberHello – Let’s reset and ignore the above materials and focus on a specific error that is IDE related and probably has a nice simple answer.
Anyone have a clue why the fmt: tags are not being recognized as such (tags) in my XSL transform file?
It is easy to see that the Eclipse IDE does not see the code as ‘code’ and just includes it as straight text in the output.
There are no errors – the taglib ref -> xmlns:fmt=”http://java.sun.com/jsp/jstl/fmt” is in the stylesheet invocation – and, if removed, then errors are generated in the source code at all the places where fmt is presented.
For instance: the line with this code <fmt:message key=”login” /> does not color-key the word definition fmt:bundle – and the subsequent HTML output after the transform contains the string <fmt:message key=”login” /> – and not the translated I18N value – which is promptly ignored by the web-browser.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:c="http://java.sun.com/jsp/jstl/core"> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta content="text/html" http-equiv="Content-Type"> <link type="text/css" rel="stylesheet" href="/myapp/css/headframe.css"> <title>I18N Test</title> </head> <body> <fmt:bundle basename="web.fmt.intl"> <-- ERROR IN XLATION <div class="logintable" align="right"> <table class="loginref"> <tr> <td> <div align="right"> <fmt:message key="login"/> <-- ERROR IN XLATION </div> </td> <td align="left">Williams, Thomas</td> </tr> </table> </div> </fmt:bundle> </body> </html>
The taglib refs in the properties all indicate JSTL 1.1 and ‘fmt’ is in there.
What it izzz?
Thanks!
Lance Drake
===========================================MYECLIPSE:
Version: 5.1.0 GA
Build id: 20061111-5.1.0-GAECLIPSE PLATFORM:
Version: 3.2.1.r321_v20060921-b_XVA-INSQSyMtx
Build id: M20060921-0945
Lance DrakeMemberXSL Transform knows nothing about JSTL – you need to be doing that kind of ‘fmt:’ stuff with JSP
Riyad KallaMemberLance,
I just got asked to help out in this thread, and reading through everything it seems there are a lot of questions on the table, and I’m really not sure where to start.Can we back up and focus on one thing? For example, you mentioned something about XSL Transforms and support for JSTL… not something MyEclipse supports at the moment (exclusively) so I’m not sure how to answer that question.
Let’s start with some simple problem that you can provide an example for me to look at and we’ll go from there. I want to get you up and running.
-
AuthorPosts