Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

working with JSTL Problem....  RSS feed

 
Jil Nautilus
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Im using Apache Tomcat 5.0.25 Server
Ive dwld JSTL from jakarta site.
Ive placed jstl and standard jar files in the WEB-INF/lib of my webapp from
jakarta-taglibs-standard-current.

My codings :This is only a test since Im trying to use this for the first time.

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
</head>

<body>
THIS IS A TEST
JIL

2+2 is ${2+2} and 4*4 is ${4*4}<br>
${header["user-agent"]}

<c:forEach var="entry" items="${header}">
${entry.key}
${entry.value}
</c:forEach>

</body>


Ive got the result as below.

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:378)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:118)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.

and so on.

I didnt do anything else like altering web.xml.
Since Im new to this tag business its pretty diffcult to findout the error.
Pls help me on this.
Thanks in advance for any help.

Best regs,
Jil Nautilus.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need the .tld files in addition to the JAR files... and you need to edit your web.xml deployment descriptor to tell your web-app about these taglibs.

Go to this page of the Jakarta website and scroll down to the heading "Using a Custom Tag Library in Your Application". It details everything you need to do to get JSTL running.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, one shouldn't have to do that.

The tld files are present in the standard.jar file and should be automatically picked up by Tomcat if the jar is in the classpath.

It sounds as if everything is set up correctly. Please check that standard.jar is really in the WEB-INF/lib of the web app, and that it contains the tld files in a zipped folder named meta-inf.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AND that you correctly picked up the jar files for JSTL 1.1 (rather than 1.0).
 
Jil Nautilus
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx for your great help.
Ive fixed the problem by using the JSTL1.1
Thanx once again.

Now Ive got another prob.
Im trying to access sqlserver db through JSTL
Ive dwld the Microsoft SQL Server 2000 Driver for JDBC and copied msutil.jar,mssqlserver.jar and msbase.jar files in to the lib dir of the WEB-INF.

Ive used
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc dbc ataBaseName","userName","password");

to connect the sqlserver before Ive got involved with this JSTL business.

But now I dont know how to establish the connection.
Can I still use jdbc.odbc bridge or shuld I follow a diff method.How can I use the SQL Server 2000 Driver for JDBC with JSTL.

My database sever is in another computer.

I gave a try to connect to the db by the above method and use the JSTL only for retreive data but failed.

Pls let me know what should I do for this.
Thanx in advance for any commnts.
Best regs,
Jil
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!