• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem using core tags  RSS feed

Indira Raghavan
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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" %>
<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}" />
<select name=localeNames>
<c:forEach var="localeString" items="${locales.localeNames}" >
<c:when test="${selectedFlag}">
<c:when test="${f:equals(selectedLocaleString,localeString)}" >
<option selected>${localeString}</option>
<c therwise>
</c therwise>
<c therwise>
</c therwise>
<input type="submit" name="Submit" value="Get Date">

<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}


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"

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.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!