GeeCON Prague 2014*
The moose likes JSP and the fly likes a problem about java beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "a problem about java beans" Watch "a problem about java beans" New topic
Author

a problem about java beans

amanda wu
Greenhorn

Joined: Mar 16, 2003
Posts: 25
for java beans:
if User.java
package com.cartapp.user;
public class User{....}
then handoff1.jsp with line
<jsp:useBean id="handoff" scope="session" class="com.cartapp.user.User" />
...
and in server.xml,
i set
<Context path="/cartapp" docBase="c:\CARTAPP" debug="0"
reloadable="true">
where shall i store the user.java?
pls answer me since i am now always encounter the following line:
C:\jakarta-tomcat-4.1.18\work\Standalone\localhost\cartapp\jsp\handoff1_jsp.java:41: package com.cartapp.user does not exist
com.cartapp.user.User handoff = null;
Chris Baron
Ranch Hand

Joined: Mar 21, 2003
Posts: 1049
Hi,
the context-path should work with this:
<Context path="/cartapp" docBase="cartapp" debug="0" reloadable="true" />
and your compiled User.class has be in:
/cartapp/WEB-INF/classes/com/cartapp/user/
if the directories don't exist create them
cb
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

the context-path should work with this:
<Context path="/cartapp" docBase="cartapp" debug="0" reloadable="true" />

That is incorrect. Unless the cartapp application is located within container's webapps folder, which it is clearly not in the original example, the full path to the folder is needed.
hth,
bear
[ March 23, 2003: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
amanda wu
Greenhorn

Joined: Mar 16, 2003
Posts: 25
hence, what's the full address refering to the package containing User.class as in my original codes?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

Christian is correct on that score:

hth,
bear
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
One more time, seek help

Welcome to JavaRanch! Please adjust your display name to meet the JavaRanch Naming Policy.
You can change it here.

Thanks!


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
amanda wu
Greenhorn

Joined: Mar 16, 2003
Posts: 25
many thanks to all of you, and i've changed to real name
 
GeeCON Prague 2014
 
subject: a problem about java beans