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

Problem using core tags

Indira Raghavan
Greenhorn

Joined: Jul 06, 2004
Posts: 1
Hi,

I am new to JSP.
I am running Tomcat5.0.25. I have a particular problem when I try to execute an example from a tutorial that uses JSTL core taglib.

The jsp file is :

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/functions.tld" prefix="f" %>
<html>
<head><title>Localized Dates</title></head>
<body bgcolor="white">

<jsp:useBean id="locales" scope="application" class="mypkg.MyLocales"/>

<form name="localeForm" action="index.jsp" method="post">
<c:set var="selectedLocaleString" value="${param.locale}" />
<c:set var="selectedFlag" value="${!empty selectedLocaleString}" />
<b>Locale:</b>
<select name=localeNames>
<c:forEach var="localeString" items="${locales.localeNames}" >
<c:choose>
<c:when test="${selectedFlag}">
<c:choose>
<c:when test="${f:equals(selectedLocaleString,localeString)}" >
<option selected>${localeString}</option>
</c:when>
<c therwise>
<option>${localeString}</option>
</c therwise>
</c:choose>
</c:when>
<c therwise>
<option>${localeString}</option>
</c therwise>
</c:choose>
</c:forEach>
</select>
<input type="submit" name="Submit" value="Get Date">
</form>

<c:if test="${selectedFlag}" >
<jsp:setProperty name="locales" property="selectedLocaleString" value="${selectedLocaleString}" />
<jsp:useBean id="date" class="mypkg.MyDate"/>
<jsp:setProperty name="date" property="locale" value="${locales.selectedLocale}"/>
<b>Date: </b>${date.date}
</c:if>

</body>
</html>

The class files used are placed in the WEB-INF\classes\mypkg folder.
The web.xml in my context has the following content :
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
</taglib>
</web-app>

And I have obtained JSTL.jar, standard.jar and the tld files from jakarta-taglibs-standard-1.1.0 and placed them in their respective folders.

But, when the JSP executes, it does not populate the dropdown list with the locale names.

Any solutions to make this work would be of great help.

Thanks
Indira
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem using core tags