File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a problem about java beans

 
amanda wu
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1061
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
amanda wu
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hence, what's the full address refering to the package containing User.class as in my original codes?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christian is correct on that score:

hth,
bear
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
amanda wu
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
many thanks to all of you, and i've changed to real name
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic