You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Justin Kennedy <ju...@consortio.com> on 2001/01/29 19:18:26 UTC

RE: JSP probleme - ms windows specific

If you really really think it's a case problem, go to a dos window and check
out the offending directory. dos won't hide the case from you.

-----Original Message-----
From: Frederic BAGES [mailto:fredba@in-fusio.com]
Sent: Monday, January 29, 2001 9:49 AM
To: struts-user@jakarta.apache.org
Subject: RE: JSP probleme




	Thank you Steven for your remarks. I had checked all of these before
sending my first mail but it was not any of these. I've tried anything i had
in mind and now it's working. I don't really know why but i think it can be
a case (not all in uppercase ?) problem on the WEB-INF directory (I'm using
a Win.. named OS that don't show the case in the file explorer).

	You also said that struts 1.0 is comming soon but do you think it can be
considered as an error-less version ? (i.e. can I use it on a production
server ?)

	Frederic


-----Message d'origine-----
De : Steven D. Wilkinson [mailto:stevendwilkinson@acm.org]
Envoyé : lundi 29 janvier 2001 18:38
À : struts-user@jakarta.apache.org
Objet : Re: JSP probleme


Which version of struts are you using?

Note my answer is how you do it in struts 1.0 (actually form the 01-28-2001
source download)
I'm not sure how to do it in 0.5.  If you are just starting and trying to
use
0.5, I suggest you start with one of the nightly source distributions
because
1.0 should be released shortly.  Just some bug fixes and documentation
updates
as I hear on the mail lists.

That said....

The tag library descriptors must be in your WEB-INF and registered in your
web.xml and you must reference them properly in the JSP page.

<tomcat-home>/webapps/animation/WEB-INF/struts-bean.tld
                                        struts-html.tld
                                        struts-logic.tld
                                        struts-template.tld
                                        struts.tld
In your web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
  .. other stuff here Note, refer to DTD about location of taglib.  it's at
the
bottom if you are not using any ejb stuff.
  <!-- Struts Tag Library Descriptors -->
  <taglib>
    <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
  </taglib>

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

</web-app>

You only need to enter the ones that you are using.  This is from the
struts-example/WEB-INF/web.xml file.

Then in you JSP page put this...
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

Note, the file in the uri determines the name and location of the tlds.  The
prefix is upto you.

Good luck,
Steve


Frederic BAGES wrote:
>
>  Hi all, i'm new to Struts and i have i problem that seems to concern
Tomcat
> and Struts.
>
>         I've installed Strut and the two exemples WAR files under tomcat
3.2. the
> exemples are just running fine but when i try to run my own jsp file i
have
> an error from the jsp compiler.
>
> org.apache.jasper.compiler.CompileException:
> C:\jakarta-tomcat-3.2.1\webapps\animation\logon.jsp(1,0) Unable to open
> taglibrary /WEB-INF/struts.tld : Could not locate TLD META-INF/taglib.tld
>         at
>
org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEve
> ntListener.java, Compiled Code)
>         at
>
org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingList
> ener.java:116)
>         at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java,
Compiled
> Code)
>         at org.apache.jasper.compiler.Parser.parse(Parser.java, Compiled
Code)
>         at org.apache.jasper.compiler.Parser.parse(Parser.java:1042)
>         at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
>         at org.apache.jasper.compiler.Compiler.compile(Compiler.java,
Compiled
> Code)
>         at
org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
>         .....
>
>  My JSP file and the corresponding classes (LogonForm and LogonAction) are
> just copies of the examples with some little changes.
>
>         Does anyone could help me ?
>
>         Thanks.
>
>         Frederic.
>
> The JSP file is following :
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts.tld" prefix="struts" %>
>
> <html>
> <head>
> <title>Titletitle>
> </head>
> <body bgcolor="white">
>
> <struts:errors/>
>
> <struts:form action="logon.do" name="logonForm" focus="username"
>                type="com.infusio.gamezilla.portal.LogonForm">
> <table border="0" width="100%">
>
>   <tr>
>     <th align="right">
>       User name :
>     </th>
>     <td align="left">
>       <struts:text property="username" size="16" maxlength="16"/>
>     </td>
>   </tr>
>
>   <tr>
>     <th align="right">
>       Password :
>     </th>
>     <td align="left">
>       <struts:password property="password" size="16" maxlength="16"/>
>     </td>
>   </tr>
>
>   <tr>
>     <td align="right">
>       <struts:submit property="submit" value="Submit"/>
>     </td>
>     <td align="left">
>       <struts:reset/>
>     </td>
>   </tr>
>
> </table>
>
> </struts:form>
>
> </body>
> </html>


RE: JSP probleme - ms windows specific

Posted by Frederic BAGES <fr...@in-fusio.com>.
	Yes, it was what I would have done if i could, but i can't manage to make
it fail now. Remeber that under windows (and dos i think)  you don't really
control how your names are stored. I've just tried under dos and all is
written using upercase characters ... But you know, I'm a mad guy : I'm just
programming under Win 98. Yes, I know, devil is my master ;-)

	Frederic


-----Message d'origine-----
De : Justin Kennedy [mailto:justink@consortio.com]
Envoyé : lundi 29 janvier 2001 19:18
À : struts-user@jakarta.apache.org
Objet : RE: JSP probleme - ms windows specific


If you really really think it's a case problem, go to a dos window and check
out the offending directory. dos won't hide the case from you.

-----Original Message-----
From: Frederic BAGES [mailto:fredba@in-fusio.com]
Sent: Monday, January 29, 2001 9:49 AM
To: struts-user@jakarta.apache.org
Subject: RE: JSP probleme




	Thank you Steven for your remarks. I had checked all of these before
sending my first mail but it was not any of these. I've tried anything i had
in mind and now it's working. I don't really know why but i think it can be
a case (not all in uppercase ?) problem on the WEB-INF directory (I'm using
a Win.. named OS that don't show the case in the file explorer).

	You also said that struts 1.0 is comming soon but do you think it can be
considered as an error-less version ? (i.e. can I use it on a production
server ?)

	Frederic


-----Message d'origine-----
De : Steven D. Wilkinson [mailto:stevendwilkinson@acm.org]
Envoyé : lundi 29 janvier 2001 18:38
À : struts-user@jakarta.apache.org
Objet : Re: JSP probleme


Which version of struts are you using?

Note my answer is how you do it in struts 1.0 (actually form the 01-28-2001
source download)
I'm not sure how to do it in 0.5.  If you are just starting and trying to
use
0.5, I suggest you start with one of the nightly source distributions
because
1.0 should be released shortly.  Just some bug fixes and documentation
updates
as I hear on the mail lists.

That said....

The tag library descriptors must be in your WEB-INF and registered in your
web.xml and you must reference them properly in the JSP page.

<tomcat-home>/webapps/animation/WEB-INF/struts-bean.tld
                                        struts-html.tld
                                        struts-logic.tld
                                        struts-template.tld
                                        struts.tld
In your web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
  .. other stuff here Note, refer to DTD about location of taglib.  it's at
the
bottom if you are not using any ejb stuff.
  <!-- Struts Tag Library Descriptors -->
  <taglib>
    <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
  </taglib>

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

</web-app>

You only need to enter the ones that you are using.  This is from the
struts-example/WEB-INF/web.xml file.

Then in you JSP page put this...
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

Note, the file in the uri determines the name and location of the tlds.  The
prefix is upto you.

Good luck,
Steve


Frederic BAGES wrote:
>
>  Hi all, i'm new to Struts and i have i problem that seems to concern
Tomcat
> and Struts.
>
>         I've installed Strut and the two exemples WAR files under tomcat
3.2. the
> exemples are just running fine but when i try to run my own jsp file i
have
> an error from the jsp compiler.
>
> org.apache.jasper.compiler.CompileException:
> C:\jakarta-tomcat-3.2.1\webapps\animation\logon.jsp(1,0) Unable to open
> taglibrary /WEB-INF/struts.tld : Could not locate TLD META-INF/taglib.tld
>         at
>
org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEve
> ntListener.java, Compiled Code)
>         at
>
org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingList
> ener.java:116)
>         at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java,
Compiled
> Code)
>         at org.apache.jasper.compiler.Parser.parse(Parser.java, Compiled
Code)
>         at org.apache.jasper.compiler.Parser.parse(Parser.java:1042)
>         at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
>         at org.apache.jasper.compiler.Compiler.compile(Compiler.java,
Compiled
> Code)
>         at
org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
>         .....
>
>  My JSP file and the corresponding classes (LogonForm and LogonAction) are
> just copies of the examples with some little changes.
>
>         Does anyone could help me ?
>
>         Thanks.
>
>         Frederic.
>
> The JSP file is following :
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts.tld" prefix="struts" %>
>
> <html>
> <head>
> <title>Titletitle>
> </head>
> <body bgcolor="white">
>
> <struts:errors/>
>
> <struts:form action="logon.do" name="logonForm" focus="username"
>                type="com.infusio.gamezilla.portal.LogonForm">
> <table border="0" width="100%">
>
>   <tr>
>     <th align="right">
>       User name :
>     </th>
>     <td align="left">
>       <struts:text property="username" size="16" maxlength="16"/>
>     </td>
>   </tr>
>
>   <tr>
>     <th align="right">
>       Password :
>     </th>
>     <td align="left">
>       <struts:password property="password" size="16" maxlength="16"/>
>     </td>
>   </tr>
>
>   <tr>
>     <td align="right">
>       <struts:submit property="submit" value="Submit"/>
>     </td>
>     <td align="left">
>       <struts:reset/>
>     </td>
>   </tr>
>
> </table>
>
> </struts:form>
>
> </body>
> </html>