You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Martin Grüneberg <ma...@active-group.de> on 2004/06/30 10:10:30 UTC

Getting mad with jsp 2.0

Hello, hope somebody knows whats going on here...

I have a main.jsp with the following start..

<?xml version="1.0" encoding="utf-8"?>
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:html="/WEB-INF/struts-html-el.tld"
	xmlns:am="/WEB-INF/AccessManager2.tld"
	xmlns:bean="/WEB-INF/struts-bean-el.tld">
<jsp:output doctype-root-element="html"
         doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
 
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
<jsp:directive.page contentType="text/html; charset=utf-8" language="java"
/>
<html:html locale="true" xhtml="true"> 
<head>
  <html:base/>
  <title><bean:message key="login.title"/></title>
  <c:url value="/css/style.css" var="link">
	</c:url>
  <link rel="stylesheet" href="${fn:escapeXml(link)}" type="text/css"/>
  	
		<jsp:directive.include file="/jsp/ascript.jsp"/>
	
</head>
....

the /jsp/ascript.jsp looks like that:

<script type="text/javascript">
    var newWindow;

    function openInsertWindow()
    {
    	<c:url value="/messdatenPreloadAction.do" var="link">
    		<c:param name="operation" value="insertDataset"/>
		</c:url>
      newWindow =
window.open("${fn:escapeXml(link)}","_blank","resizable=yes,scrollbars=yes,w
idth=800,height=600,status=yes");
    }
...

ok, now the problem:
when i call the jsp tomcat (jasper) throws the following exception:

org.apache.jasper.JasperException: /jsp/ascript.jsp(9,33) The attribute
prefix fn does not correspond to any imported tag library

I thought ok, and added the same declaration to the /jsp/ascript.jsp include
file like in the main.jsp:

<?xml version="1.0" encoding="utf-8"?>
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:html="/WEB-INF/struts-html-el.tld"
	xmlns:am="/WEB-INF/AccessManager2.tld"
	xmlns:bean="/WEB-INF/struts-bean-el.tld">
<script type="text/javascript">
    var newWindow;

    function openInsertWindow()
    {
    	<c:url value="/messdatenPreloadAction.do" var="link">
    		<c:param name="operation" value="insertDataset"/>
		</c:url>
      newWindow =
window.open("${fn:escapeXml(link)}","_blank","resizable=yes,scrollbars=yes,w
idth=800,height=600,status=yes");
    }
...


but then i got the exception:

org.apache.jasper.JasperException: <h3>Validation error messages from
TagLibraryValidator for c</h3><p>null: 
org.xml.sax.SAXParseException: Attribute "bean" bound to namespace
"http://www.w3.org/2000/xmlns/" was already 
specified for element "jsp:root".</p>

ok, this seems to be logical to me, because it is alredy declared in
main.jsp.

What can i do to fix this, to get the taglib known in the include but not
double import it???

thanks in advance
Martin Grüneberg
 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


AW: Getting mad with jsp 2.0

Posted by Martin Grüneberg <ma...@active-group.de>.
Thanks for the answer, 

but the  <jsp:directive.include ... is the xml-styled version of <%@ include
file=...
so this should work equaly. 

Any other proposals?

martin
 
-----Ursprüngliche Nachricht-----
Von: Woodchuck [mailto:woodchuck_5@yahoo.com] 
Gesendet: Mittwoch, 30. Juni 2004 16:23
An: Tomcat Users List
Betreff: Re: Getting mad with jsp 2.0 <jsp:directive.include
file="file_to_include.jsp"/>

hi Martin,

can you try to use the compile-time include like the following:

<%@ include file="/jsp/ascript.jsp"%>

instead of the run-time include that you are currently using?  that is
why it is complaining about double importing.

if you use compile-time include then you do not need to import in your
ascript.jsp

woodchuck
 

--- Martin_Gr|neberg <ma...@active-group.de> wrote:
> Hello, hope somebody knows whats going on here...
> 
> I have a main.jsp with the following start..
> 
> <?xml version="1.0" encoding="utf-8"?>
> <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" 
> 	xmlns="http://www.w3.org/1999/xhtml"
> 	xmlns:c="http://java.sun.com/jsp/jstl/core"
> 	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
> 	xmlns:html="/WEB-INF/struts-html-el.tld"
> 	xmlns:am="/WEB-INF/AccessManager2.tld"
> 	xmlns:bean="/WEB-INF/struts-bean-el.tld">
> <jsp:output doctype-root-element="html"
>          doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
>  
>
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
> />
> <jsp:directive.page contentType="text/html; charset=utf-8"
> language="java"
> />
> <html:html locale="true" xhtml="true"> 
> <head>
>   <html:base/>
>   <title><bean:message key="login.title"/></title>
>   <c:url value="/css/style.css" var="link">
> 	</c:url>
>   <link rel="stylesheet" href="${fn:escapeXml(link)}"
> type="text/css"/>
>   	
> 		<jsp:directive.include file="/jsp/ascript.jsp"/>
> 	
> </head>
> ....
> 
> the /jsp/ascript.jsp looks like that:
> 
> <script type="text/javascript">
>     var newWindow;
> 
>     function openInsertWindow()
>     {
>     	<c:url value="/messdatenPreloadAction.do" var="link">
>     		<c:param name="operation" value="insertDataset"/>
> 		</c:url>
>       newWindow =
>
window.open("${fn:escapeXml(link)}","_blank","resizable=yes,scrollbars=yes,w
> idth=800,height=600,status=yes");
>     }
> ...
> 
> ok, now the problem:
> when i call the jsp tomcat (jasper) throws the following exception:
> 
> org.apache.jasper.JasperException: /jsp/ascript.jsp(9,33) The
> attribute
> prefix fn does not correspond to any imported tag library
> 
> I thought ok, and added the same declaration to the /jsp/ascript.jsp
> include
> file like in the main.jsp:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" 
> 	xmlns="http://www.w3.org/1999/xhtml"
> 	xmlns:c="http://java.sun.com/jsp/jstl/core"
> 	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
> 	xmlns:html="/WEB-INF/struts-html-el.tld"
> 	xmlns:am="/WEB-INF/AccessManager2.tld"
> 	xmlns:bean="/WEB-INF/struts-bean-el.tld">
> <script type="text/javascript">
>     var newWindow;
> 
>     function openInsertWindow()
>     {
>     	<c:url value="/messdatenPreloadAction.do" var="link">
>     		<c:param name="operation" value="insertDataset"/>
> 		</c:url>
>       newWindow =
>
window.open("${fn:escapeXml(link)}","_blank","resizable=yes,scrollbars=yes,w
> idth=800,height=600,status=yes");
>     }
> ...
> 
> 
> but then i got the exception:
> 
> org.apache.jasper.JasperException: <h3>Validation error messages from
> TagLibraryValidator for c</h3><p>null: 
> org.xml.sax.SAXParseException: Attribute "bean" bound to namespace
> "http://www.w3.org/2000/xmlns/" was already 
> specified for element "jsp:root".</p>
> 
> ok, this seems to be logical to me, because it is alredy declared in
> main.jsp.
> 
> What can i do to fix this, to get the taglib known in the include but
> not
> double import it???
> 
> thanks in advance
> Martin Gr|neberg
>  
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Getting mad with jsp 2.0

Posted by Woodchuck <wo...@yahoo.com>.
hi Martin,

can you try to use the compile-time include like the following:

<%@ include file="/jsp/ascript.jsp"%>

instead of the run-time include that you are currently using?  that is
why it is complaining about double importing.

if you use compile-time include then you do not need to import in your
ascript.jsp

woodchuck
 

--- Martin_Gr�neberg <ma...@active-group.de> wrote:
> Hello, hope somebody knows whats going on here...
> 
> I have a main.jsp with the following start..
> 
> <?xml version="1.0" encoding="utf-8"?>
> <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" 
> 	xmlns="http://www.w3.org/1999/xhtml"
> 	xmlns:c="http://java.sun.com/jsp/jstl/core"
> 	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
> 	xmlns:html="/WEB-INF/struts-html-el.tld"
> 	xmlns:am="/WEB-INF/AccessManager2.tld"
> 	xmlns:bean="/WEB-INF/struts-bean-el.tld">
> <jsp:output doctype-root-element="html"
>          doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
>  
>
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
> />
> <jsp:directive.page contentType="text/html; charset=utf-8"
> language="java"
> />
> <html:html locale="true" xhtml="true"> 
> <head>
>   <html:base/>
>   <title><bean:message key="login.title"/></title>
>   <c:url value="/css/style.css" var="link">
> 	</c:url>
>   <link rel="stylesheet" href="${fn:escapeXml(link)}"
> type="text/css"/>
>   	
> 		<jsp:directive.include file="/jsp/ascript.jsp"/>
> 	
> </head>
> ....
> 
> the /jsp/ascript.jsp looks like that:
> 
> <script type="text/javascript">
>     var newWindow;
> 
>     function openInsertWindow()
>     {
>     	<c:url value="/messdatenPreloadAction.do" var="link">
>     		<c:param name="operation" value="insertDataset"/>
> 		</c:url>
>       newWindow =
>
window.open("${fn:escapeXml(link)}","_blank","resizable=yes,scrollbars=yes,w
> idth=800,height=600,status=yes");
>     }
> ...
> 
> ok, now the problem:
> when i call the jsp tomcat (jasper) throws the following exception:
> 
> org.apache.jasper.JasperException: /jsp/ascript.jsp(9,33) The
> attribute
> prefix fn does not correspond to any imported tag library
> 
> I thought ok, and added the same declaration to the /jsp/ascript.jsp
> include
> file like in the main.jsp:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" 
> 	xmlns="http://www.w3.org/1999/xhtml"
> 	xmlns:c="http://java.sun.com/jsp/jstl/core"
> 	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
> 	xmlns:html="/WEB-INF/struts-html-el.tld"
> 	xmlns:am="/WEB-INF/AccessManager2.tld"
> 	xmlns:bean="/WEB-INF/struts-bean-el.tld">
> <script type="text/javascript">
>     var newWindow;
> 
>     function openInsertWindow()
>     {
>     	<c:url value="/messdatenPreloadAction.do" var="link">
>     		<c:param name="operation" value="insertDataset"/>
> 		</c:url>
>       newWindow =
>
window.open("${fn:escapeXml(link)}","_blank","resizable=yes,scrollbars=yes,w
> idth=800,height=600,status=yes");
>     }
> ...
> 
> 
> but then i got the exception:
> 
> org.apache.jasper.JasperException: <h3>Validation error messages from
> TagLibraryValidator for c</h3><p>null: 
> org.xml.sax.SAXParseException: Attribute "bean" bound to namespace
> "http://www.w3.org/2000/xmlns/" was already 
> specified for element "jsp:root".</p>
> 
> ok, this seems to be logical to me, because it is alredy declared in
> main.jsp.
> 
> What can i do to fix this, to get the taglib known in the include but
> not
> double import it???
> 
> thanks in advance
> Martin Gr�neberg
>  
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org