Tag Library Issue

Hi all i am new to the board and in need of some assistance

JSP based program (Fantasy football) i am working on using tomcat server 5.0 is giving me problems.I am using core and formatting tag libraries on the maiin jsp page and have added the prefixes as such

<!--

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

-->

i have also added the standard and jstl jar files to the web/web-inf direcotry within the application.

Yet on trying to load the jsp page i am getting error "http://java.sun.com/jsp/jstl/fmt cannot be resolved in either web.xml or jar files". I have a web.xml file set up.

My question is, is there any further configuration needed before the tag libraries are recognised? Any feedback would be welcome.

Thanks!!

[892 byte] By [Styx21a] at [2007-11-26 15:29:34]
# 1

Hi the first part of the following link can help u

http://www.roseindia.net/jstl/introduction.shtml

however why don't U try out by placing

c.tld, x.tld, fmt.tld,sql.tld,fn.tld under WEB-INF folder

and add

<taglib>

<taglib-uri>c.tld</taglib-uri>

<taglib-location>/WEB-INF/c.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>x.tld</taglib-uri>

<taglib-location>/WEB-INF/x.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>sql.tld</taglib-uri>

<taglib-location>/WEB-INF/sql.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>fmt.tld</taglib-uri>

<taglib-location>/WEB-INF/c.tld</taglib-location>

</taglib>

to web.xml as a work around

and try adding

<%@ taglib prefix="fmt" uri="fmt.tld" %>

<%@ taglib prefix="c" uri="c.tld" %>

<%@ taglib prefix="sql" uri="sql.tld" %>

<%@ taglib prefix="x" uri="x.tld" %>

to your JSP whenever you are trying to use JSTL tag libraries

I'd alwys try wid it first

RahulSharnaa at 2007-7-8 21:45:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hi,

Thank you for your help,these seems to have worked as my jsp page will now load.There is one more problem however.

When clicking the Add button to add team to db within my application it is trying to access the AdminServlet page . I am using a bean called roster to transfer over name of team that must be added to db as such

<jsp:useBean id="roster" class="java.util.ArrayList" scope="request" />

<jsp:useBean id="SERVLET_PATH" class="java.lang.String" scope="request" />

in my form actions i have

action="<c:out value="${SERVLET_PATH}" />" method="POST"

when i click the add button it is trying to load my Servlet page than passing information to method within it.Any ideas?

Styx21a at 2007-7-8 21:45:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Putting those entries in web.xml is the old way of doing things.

If you are getting that error message, I think it is more likely you have installed JSTL1.0 rather than JSTL1.1 (which you should on Tomcat 5+)

See this thread (reply #6) for more info on JSTL/Tomcat verions

http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0

>when i click the add button it is trying to load my Servlet

>page than passing information to method within it.Any ideas?

Your last statement is confusing me a little.

The valid values for the method tag are "GET" and "POST"

It does not actually specify a method in your servlet to call, rather it tells the browser which method to use when submitting parameters - GET (including the parameters with the url) or POST (including parameters in a seperate stream)

It should end up in the doPost() method of your servlet, because that is what handles POST requests.

evnafetsa at 2007-7-8 21:45:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

"The absolute uri: http://java.sun.com/jsp/jstl/fmt cannot be resolved in either web.xml or the jar files deployed with this application

"

Still recieving this error

standard and jstl1 from jstl 1.1 jar files are within the applications web/web-inf folder (and the ROOT/WEB-INF/lib directory)

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

added to my jsp page

web.xml as follows

"<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

version="2.4">"

Still not working.If i refresh the page it will appear but if i refresh again the error above appears.What is going on? Any feedback appreciated. :)

Styx218a at 2007-7-8 21:45:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...