Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Struts TagLibs

0 views
Skip to first unread message

Claus Wanner

unread,
Oct 8, 2002, 5:40:17 AM10/8/02
to
Hi NG,
irgendwie klappt bei mir die verwendung der Struts-TagLibs nicht.

Meine Source sieht wie folgt aus (ShowTag.jsp):

<%@ taglib uri="/WEB-INF/tld/show.tld" prefix="buch" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>

<html>
<head>
<link rel="stylesheet" type="TEXT/CSS" href="jsp.css">
</head>
<body>
<buch:showTitle dbname="mydbname" dbuser="mydbuser" dbpass="mydbpass"/>
<p>
<table>
<%
java.util.Enumeration e1 = request.getParameterNames();
String strPARAM;
int strLen = request.getParameter("strPARAM").length();
%>

<logic:greaterThan parameter="<% out.prinln(strlen); %>" value="0">
<buch:dataTable />
</logic:greaterThan>

</table>
</body>
</html>

... dabei bekomme ich folgende Fehlermeldung:

javax.servlet.ServletException
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java)

at_0002fShowTag_0002ejspShowTag_jsp_23._jspService(_0002fShowTag_0002ejspSho
wTag_jsp_23.java:154)
[...]

Root cause:
java.lang.NullPointerException

at_0002fShowTag_0002ejspShowTag_jsp_23._jspService(_0002fShowTag_0002ejspSho
wTag_jsp_23.java:92)
[...]

Die Strutsklassen CLASS- und TLD-Files liegen in den Verzeichnissen
/WEB-INF/classes und /WEB-INF/tld
In der web.xml steht u.a.
<taglib>
<taglib-uri>struts-logic</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
</taglib>

Meine Konfig:
SuSE Linux 7.3 mit Tomcat 3.2.3, Struts 1.0.2 und JDK1.4.0

Thx.
--
Claus
;-]
Documentations and Sex:
it is good, it's very very good - is it bad, it is better than nothing


Raffael Herzog

unread,
Oct 8, 2002, 6:25:33 AM10/8/02
to
Hi Claus,

Claus Wanner schrieb:

> Hi NG,
> irgendwie klappt bei mir die verwendung der Struts-TagLibs nicht.
>
> Meine Source sieht wie folgt aus (ShowTag.jsp):
>
> <%@ taglib uri="/WEB-INF/tld/show.tld" prefix="buch" %>
> <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
> <taglib>
> <taglib-uri>struts-logic</taglib-uri>
^^^^^^^^^^^^
> <taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
> </taglib>

Finde die zehn Unterschiede... :-)

(Was aber IMHO nicht die wenig aussagekräftige Vehler-
meldung entschuldigt)


Gruss,

Raffi


--
=> Neu im Usenet? Fragen? http://www.use-net.ch/usenet_intro_de.html <=
The difference between theory and practice is that in theory, there is
no difference, but in practice, there is.
Raffael Herzog - her...@raffael.ch - http://www.raffael.ch - ICQ #67961355

Claus Wanner

unread,
Oct 8, 2002, 7:32:05 AM10/8/02
to
> > <taglib-uri>struts-logic</taglib-uri>
> ^^^^^^^^^^^^

> > <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Der Fehler liegt also hier begraben, nur komm ich nicht dahinter wo, wie und
was!
Der Pfad stimmt eigentlich, ich hab die TLDs an diese Stelle kopiert oder
muss ich auf die "Originale" verweisen?

Für die nahezu geniale Fehlermeldung kann ich nichts,
wenn der TomCat mir nichts anderes liefert
*seufz*


Thx & cya

Raffael Herzog

unread,
Oct 8, 2002, 7:48:14 AM10/8/02
to
Hi Claus,

Claus Wanner schrieb:

> > > <taglib-uri>struts-logic</taglib-uri>


> > ^^^^^^^^^^^^
>
> > > <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Der Fehler liegt also hier begraben, nur komm ich nicht dahinter wo, wie und
> was!
> Der Pfad stimmt eigentlich, ich hab die TLDs an diese Stelle kopiert oder
> muss ich auf die "Originale" verweisen?

Die taglib-uri kannst du als Identifier für die Taglib
betrachten. Wenn du die Taglib in web.xml als "struts-logic"
deklarierst, musst du sie in der JSP auch als "struts-logic"
einbinden, sonst weiss der Container nicht, welche Taglib du
meinst. Du versuchst gerade, die Taglib als "A" zu deklarie-
ren und als "B" einzubinden.


> Für die nahezu geniale Fehlermeldung kann ich nichts,
> wenn der TomCat mir nichts anderes liefert

Schon klar... :-)

Claus Wanner

unread,
Oct 8, 2002, 9:59:50 AM10/8/02
to
Ahhh Ja, jetzt gehts!
Big Thx!

cya
--
Claus
;-]
Documentations and Sex:
it is good, it's very very good - is it bad, it is better than nothing

"Raffael Herzog" <dev...@raffael.ch> schrieb im Newsbeitrag
news:87y999r...@mail.raffael.ch...

0 new messages