Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 13th, 2003, 09:40 PM
Registered User
Join Date: Oct 2003
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 4 - CarBean.java

I am trying to use a javaBean with Tomcat 4.1.27. I can not get it to work by following the instructions on page 78 of the Beginning JSP Web Development book released in 2001. I think the instructions are outdated.

Could someone please explain to me where I should save the CarBean.java file if I make it part of the package com.wrox.cars;

I will be invoking it from the following web page at url:
Here is carPage.jsp:
        <title>Using a JavaBean</title>

    <h2>Using a JavaBean</h2>

    <% com.wrox.cars.CarBean myCar = new com.wrox.cars.CarBean(); %>
    I own a <%= myCar.getMake() %> <br />
    <% myCar.setMake("Porche"); %>
    Now I own a <%= myCar.getMake()%>

Here is CarBean.java:
package com.wrox.cars;

import java.io.Serializable;

public class CarBean implements Serializable{

    public CarBean(){

    private String make = "Ford";

    public String getMake(){
        return make;

    public void setMake(String make){
    this.make = make;

Reply With Quote
  #2 (permalink)  
Old October 13th, 2003, 10:21 PM
Registered User
Join Date: Oct 2003
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

I changed the properties of file Web-inf to be share as WEB-INF.
This fixed the problem I was having.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Root Cause:java.lang.NoSuchMethodError: java.util. anees81 JSP Basics 3 March 1st, 2011 08:55 AM
java.lang.OutOfMemoryError: Java heap space meetkotresh J2EE 1 February 2nd, 2008 01:52 AM
Java Code - Wrox - Beginning JAVA - Ivor Horton ponguru Java Databases 3 May 18th, 2006 12:30 PM
Java vs Java Script functions joemorrison74 J2EE 0 July 6th, 2005 04:28 PM
Problems with Java Mail Please advise "Chapter 9" PatrickWalsh JSP Basics 1 September 5th, 2004 06:46 PM

All times are GMT -4. The time now is 08:37 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.