Hi,
I have JSTL set up in MyEclipse for the current project. When I "deploy" the project, MyEclipse copies the jstl.jar and standard.jar and all the .tld files to the Webapps folder.
However, when I try to run the code, the "$" don't expand to show me what's in the variables. Clearly, I've got something set up wrong.
Below, I have my source code, the URL I used in the browser, and the browser's output.
I would appreciate any help or suggestions why this isn't working.
Here's my
test JSP page:
<%@ page language="java" import="java.util.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName()
+ ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'MyJsp.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<%@ taglib uri='http://java.sun.com/jstl/core' prefix='c'%>
This is my JSP page.
<%
String s = "JSTL is cool.";
pageContext.setAttribute("name", s);
%>
Getting ready to do some JSTL ...
<br>
<c:if test ='$(not empty param.amount)'>
<c
ut value='$(param.amount)' />
<c
ut value='$(name)' />
</c:if>
Okay, here's the value of name...
<br>
<c
ut value='$(name)' />
Here's the value of param.amount
<br>
<c
ut value='$(param.amount)' />
</body>
</html>
======================================
URL line in browser:
http://localhost/JSTLTest/MyJsp.jsp?amount=100 Here's the output with the above URL line:
This is my JSP page. Getting ready to do some JSTL ...
Okay, here's the value of name...
$(name) Here's the value of param.amount
$(param.amount)
===================================
Look forward to any replies or suggestions why this isn't working.
Thanks.
-- Mike