aspose file tools*
The moose likes JSP and the fly likes Regarding JSTL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Regarding JSTL" Watch "Regarding JSTL" New topic
Author

Regarding JSTL

Prasad Babu
Ranch Hand

Joined: Jul 17, 2005
Posts: 57
Hi,
When I am trying to use JSTL(SQL & Core), I am getting the following exception in Tomcat server. I kept all require .jar files (jstl, standard etc.) in the application /WEB-INF/lib directory. the following is the jsp file i am trying.

<%@ taglib prefix="sql"
uri="http://java.sun.com/jstl/sql" %>
<sql:setDataSource var="dataSrc"
url="jdbc dbc rofileMng" driver="sun.jdbc.odbc.JdbcOdbcDriver"
user="" password=""/>

<sql:query var="queryResults" dataSource="${dataSrc}">
select * from bobdb where hr = ?
<sql aram value="Ramya"/>
</sql:query>

<html><head><title></title></head><body>
<table border="1">
<tr>
<th>Name</th>
<th>E-mail</th>
<th>Mobile</th>
<th>Technology</th>
<th>Experience</th>
</tr>
<c:forEach var="row" items="${queryResults.rows}">
<tr>
<td><c ut value="${row.name}"/></td>
<td><c ut value="${row.email}"/></td>
<td><c ut value="${row.mobile}"/></td>
<td><c ut value="${row.technology}"/></td>
<td><c ut value="${row.exp}"/></td>
</tr>
</c:forEach>
</table>
</body>
</html>
----------------------------------------------------------------------
The exception is ----------

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /index.jsp(7,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:150)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:941)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:696)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Validator.validate(Validator.java:1475)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:214)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.0.28


Please help me.

Thanks in Advance.
Prasad
Steve McCann
Ranch Hand

Joined: Oct 20, 2004
Posts: 81
I don't think the setDataSource tag accepts the 'var=' attribute. Try changing var= to dataSource=.

Cheers
Steve
[ October 21, 2005: Message edited by: Steve McCann ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regarding JSTL