Beginner needs some help with JSP...

Posted on 2007-08-04
Last Modified: 2008-03-06
I recently decided that I wanted to learn JSP. I have a background in j2se, and coldfusion. I downloaded and installed tomcat 6, and got a book called Beginning JSP 2, however, I am finding that none of the examples in the book seem to work with tomcat 6, it appears that it was designed for tomcat 5.0.16... anyways I am having trouble with the taglib directive... I am trying to do something really really simple like this:

<%@ taglib uri="" prefix="c" %>
   <c:redirect url="">

Anyways can someone please point me in the direction of a good online JSP Tutorial, or recommend a good book to learn from, and possibly tell me how to get the above example to work?

Worth 500 points.

Question by:richardsimnett
    LVL 27

    Accepted Solution

    Download the Standard 1.1 Taglib  
    and read this,  
    Basically, put the two jars in <yourTomcatHome>\lib
                   and use this on the top of your JSP.
    <%@ taglib uri="" prefix="c" %>

    Author Comment

    ok.... one last question and I will give you the points. I am also trying to use the SQL JSTL package, and not having any luck... How do I get it to work cuz I get the following error:

    HTTP Status 500 -

    type Exception report


    description The server encountered an internal error () that prevented it from fulfilling this request.


    org.apache.jasper.JasperException: /opencatch.jsp(20,0) Attribute datasource invalid for tag query according to TLD

    Also how do I determine the # of rows returned by a query? Here is my code so far:

    <%@ taglib uri="" prefix="c" %>
    <%@ taglib uri="" prefix="sql" %>

    <c:forEach var="entry" items="${header}">
            Key: ${entry.key}<br>
            Value: ${entry.value}<br><br>

    <!---- execute database update ---->
    <sql:setDataSource var="ds"
         user="root" password="test" />

    <sql:query var="login" datasource="${ds}">
            select * from users where username='${param.username}' and password='${param.password}'

    <h1>Database Access</h1>
    UserID: ${}



    Author Comment

    nevermind I got it.


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    java.util.concurrent.locks in java 3 169
    spring AOP 6 64
    EJB MDB example 4 73
    servlet init param and contect param 3 46
    Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
    Read about the 3 stages of the buyer's journey: awareness, consideration, and decision.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now