Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 23rd, 2003, 10:47 AM
Registered User
 
Join Date: Jul 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default JSP 2.0 p484 errata

Hi-

I racked my brains trying to get the sample code to work. Here
is what you need to do.

First, add the following line to the code
on page 484 of JSP 2.0:

   <ResourceParams name ="jdbc/BooksDB">

It goes after the <Resource .../> tag and before
the first <parameter> tag.

2nd be sure to put mysql-connector-java-3.0.8-stable-bin.jar in your classpath or in $JAVA_HOME/jre/lib/ext. The authors fail to remind the readers about this one. So be careful.

I changed driverClassName value in server.xml to:
 com.mysql.jdbc.Driver
Check the readme in the mysql-connector-java
download for the specifics.



Hope This Helps,

Newtonian

 
Old February 23rd, 2004, 04:25 AM
Registered User
 
Join Date: Jul 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ioda006
Default

Ok, I've copied the Wrox Code from the download and I'm pretty sure there's not much that can go wrong in that simple class and jsp anyway and I still can't get this first example to work.

    <Context path="/Advanced" docBase="Advanced" debug="5" reloadable="true" crossContext="true">

    <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_Advanced_log." suffix=".txt" timestamp="true"/>

    <Resource name="jdbc/BooksDB" auth="Container" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/BooksDB">
    <parameter>
     <name>factory</name>
     <value>org.apache.commons.dbcp.BasicDataSourceFact ory</value>
    </parameter>
    <parameter>
     <name>maxActive</name>
     <value>100</value>
    </parameter>
    <parameter>
     <name>maxIdle</name>
     <value>30000</value>
    </parameter>
    <parameter>
     <name>maxWait</name>
     <value>100</value>
    </parameter>
    <parameter>
     <name>username</name>
     <value>bookuser</value>
    </parameter><parameter>
     <name>password</name>
     <value>bookpass</value>
    </parameter>
    <parameter>
     <name>driverClassName</name>
     <value>com.mysql.jdbc.Driver</value>
    </parameter>
    <parameter>
     <name>url</name>
     <value>jdbc:mysql://localhost:3306/books</value>
    </parameter>
        </ResourceParams>
       </Context>
      </Host>

    </Engine>

  </Service>

</Server>


does any of that look wrong?
 
Old February 23rd, 2004, 04:27 AM
Registered User
 
Join Date: Jul 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ioda006
Default

I'll also note that I did copy the mysql-connector-java-3.0.11-stable-bin.jar to the G:\j2sdk1.4.2_03\jre\lib\ext directory.

 
Old February 23rd, 2004, 10:56 PM
Registered User
 
Join Date: Jul 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ioda006
Default

AHH!! i found the problem.. i had put the mysql connector along with the pooling, collections and dbcp .jar's into the web-inf/lib directory

http://jakarta.apache.org/tomcat/tom...les-howto.html

that page is extremely helpful... id also like to note that the first example is pretty much the exact same thing thats in the wrox book.. hmm =)






Similar Threads
Thread Thread Starter Forum Replies Last Post
JSP 2.0 p457 errata Chapter 12 newtonian JSP Basics 0 March 10th, 2004 02:04 PM
JSP 2.0 p458 errata Chapter 12 newtonian JSP Basics 0 March 10th, 2004 01:53 PM
JSP 2.0 p459 errata Chapter 12 newtonian JSP Basics 0 March 10th, 2004 01:42 PM
JSP 2.0 p492 errata newtonian JSP Basics 0 July 24th, 2003 12:10 PM
Errata for Professional JSP 2nd Edition msobczak Pro JSP 0 June 4th, 2003 08:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.