Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning JavaServer Pages
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning JavaServer Pages
This is the forum to discuss the Wrox book Beginning JavaServer Pages by Vivek Chopra, Jon Eaves, Rupert Jones, Sing Li, John T. Bell; ISBN: 9780764574856
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaServer Pages 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 13th, 2005, 03:38 PM
Registered User
 
Join Date: May 2005
Location: San Diego, CA, .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default CH3- java class imported, but still undefined

I'm trying to set up a test a simple jsp setup based off of Chapter 3 example 1. It's very simple - an index which has a link to a log in page, a log in page, and a logged in page. Im not concerned with forms or anything like that. My problem is I'm using "User.java" and "User.class" that are stored in WEB-INF/classes/custom. The Testing.war includes these. The first line in User.java is "package custom;" and the first line of the log in page is <%@ page language="java" import="custom.*,java.util.*"> copied from the chapter 3 example 1 format. For some reason, User is undefined. I debugged with Sun ONE Studio 5, and found that it looks like its correctly importing both custom.* and java.util.*
I can't figure out why User is undefined. I made sure to look at everything from the chapter 3 example 1 (and WEB-INF) and everything is in the same format.

Here's what the directory looks like
ROOT: Testing

Testing
- WEB-INF
| - classes
| | - custom
| | | - User.java
| | | - User.class
| - lib
| | - jstl.jar
| | - standard.jar
| - web.xml
- META-INF
- main
| - index.jsp // only contains a header and a link to page.jsp
| - page.jsp // Trying to use the User object (has a log in form)
| - page2.jsp // displays whether the test application works or not
- Testing.war

Any ideas?
Reply With Quote
  #2 (permalink)  
Old May 19th, 2005, 08:13 PM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's unusual to put the User.java in the WEB-INF/classes directory. While this is not likely to be causing you issues, this might indicate that your development environment is not setup quite correctly.

Running Tomcat or other containers within an IDE can be problematic due to classloading issues. I would suggest trying to run this from a command line to see what happens.
Reply With Quote
  #3 (permalink)  
Old May 20th, 2005, 12:02 PM
Registered User
 
Join Date: May 2005
Location: San Diego, CA, .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To be honest, I am beginning with web-applications - no real experience with that, and I only am slightly familiar with java from a semester class several years ago. But, I am quite familiar with C and C++ used with visual studio, so I don't know how to run this from a command line. I do now know how to compile with command line, use ant with command line, but that's about it.

Reply With Quote
Reply


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
Java Best Practices Class gxp Spring 0 August 21st, 2008 06:02 PM
Java Gui (Reload Class) Axar Java GUI 0 June 10th, 2006 05:35 PM
Using Java class from C# gettipu J2EE 0 February 7th, 2005 06:57 PM
undefined class name-oracle junemo Oracle 1 June 2nd, 2004 10:28 AM
java class edit mode mateenmohd Java GUI 2 March 8th, 2004 06:31 AM



All times are GMT -4. The time now is 04:05 PM.


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