For my code below, I tried both "core_rt" and "core" methods. It just won't work, and I got error messages like "org.apache.jasper.JasperException: The absolute uri:
http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application". HELP...!
But I'm able to connect using this method:
"
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<% Class.forName("com.mysql.jdbc.Driver").newInstance (); ...
String url = "jdbc:mysql://localhost/ise";
String user = "abc";
String password = "abc";
Connection conn = DriverManager.getConnection(url,user,password);%>
"
Below is my original code (which have problem):
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
<sql:setDataSource var="datasource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/ise
user="abc" password="abc" />
<sql:query var="user" dataSource="${datasource}">
SELECT * FROM users
</sql:query>
<html>
<head>
<title>mysql test</title>
</head>
<body>
<table border="1">
<tr>
<th>uid</th>
<th>user name</th>
<th>e-mail</th>
<th>contact</th>
<th>password</th>
<th>access level</th>
</tr>
<c:forEach i="${user.rows}" var="row">
<tr>
<td><c:out value="${row.uid}" /></td>
<td><c:out value="${row.userName}" /></td>
<td><c:out value="${row.contactNum}" /></td>
<td><c:out value="${row.email}" /></td>
<td><c:out value="${row.password}" /></td>
<td><c:out value="${row.accessLevel}" /></td>
</tr>
</c:forEach>
</table>
</body>
</html>