• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

a problem about java beans

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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;
 
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Christian is correct on that score:

hth,
bear
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
many thanks to all of you, and i've changed to real name
reply
    Bookmark Topic Watch Topic
  • New Topic