OK, I think I understand the idea of organizing beans, but does that
organization affect how the JSP/Servlets talk to the beans? For example if I
have a bean in package shopping and that bean is located in WEB-INF\classes
not in WEB-INF\classes\shopping, will the bean still work even though its
not located in a direcotry corasponding to its package name?

The reason I am asking is that I am having a hard time compiling a Servlet
that imports shopping.Item; which is my bean. The bean compiles fine, just
that when I compile the Servlet using JBuilder I get a error message saying
that shopping.Item; can't be imported.

I get completely different error when compiling through the command line in
W2K Server and Linux.

Aaron

                <<:::..:::...::: Aaron Prohaska :::..:::...:::>>
VerdeSoft Internet Services
mailto:[EMAIL PROTECTED]          http://www.verdesoft.net/


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Donald Vandenbeld
Sent: Thursday, July 20, 2000 7:24 AM
To: [EMAIL PROTECTED]
Subject: Re: [JSP-INTEREST] Storing sessions


Well, I'm not comfortable trying for an authoritative explanation of
packages, but I can give you the basics.  Packages basically just help you
to organize your classes (including beans) in a hierarchical way.  Packages
names have a correlation to the directory that your store you classes in.
If your beans normally reside in the directory WEB-INF\classes, but you
place some of your beans in the package "myapp", those beans would reside in
the directory WEB-INF\classes\myapp.  If you plan to distribute your beans,
I believe the convention is to use your domain name as the prefix to your
package name, starting with the top level domain.  For instance, if you own
the domain wizbang.com and you are distributing shopping cart beans, your
beans would (for instance) be in the package "com.wizbang.shopping" and they
would reside in the WEB-INF\classes\com\wizbang\shopping directory.

Let's say you had a product bean called "ProductBean" in the package used
above.  You'd have:
package com.wizbang.shopping;
as the first line of the bean.

If another class (say a servlet) wanted to use that bean, it would import it
using:
import com.wizbang.shopping.ProductBean;

If you wanted to use that mean in a JSP page, you'd use the tag:
<jsp:useBean id="aProduct" scope="session"
class="com.wizbang.shopping.ProductBean" />

Hope this helps,
Donald

----- Original Message -----
From: "Aaron Prohaska" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 19, 2000 4:39 PM
Subject: Re: Storing sessions


>
>
> OK, I have been playing with this and wrote my project following the
> examples in the link you sent. I am having problems compiling the servlet
> because it doesn't know about the Bean. I think my problem here is that I
> don't understand packages. Can you or someone else explain how packages
work
> for me?
>
> thanks,
>
> Aaron
>
>                 <<:::..:::...::: Aaron Prohaska :::..:::...:::>>
> VerdeSoft Internet Services
> mailto:[EMAIL PROTECTED]          http://www.verdesoft.net/
>
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Donald Vandenbeld
> Sent: Tuesday, July 18, 2000 12:21 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [JSP-INTEREST] Storing sessions
>
>
> I think the easiest thing to do would be to create a bean for each item
> (with item number, decription, price, and quantity properties) and then
keep
> a vector of these beans as a session variable.
>
> I think this article is what you are looking for:
> http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html
>
> ----- Original Message -----
> From: "Aaron Prohaska" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 18, 2000 12:27 PM
> Subject: Storing sessions
>
>
> >
> >
> > Hello all. I am trying to figure out how to store a group of parameters
in
> > session so that I can store multiple groups and print this out into an
> html
> > table. What I can't figure out is how to store a group of parameters in
> the
> > session object. My group of parameters consists of this: Item,
> Description,
> > Price, Quantity, and Total. Now I need to store those five parameters
with
> > difference values for each item that I have. So my html table would look
> > something like this.
> >
> > Item            Description             Price           Quantity
> Total
> > 8923            some description        $80.29          4
> $321.16
> > 2983            second product desc     $20.50          2
> $41.00
> >
> > I have been thinking about holding this information in an object and
then
> > holding the object in session, but I can't figure out how to a uniqe
> object
> > for each product. I also realize that a database would be the best way
to
> do
> > this, but I can't use a database for this, so session seemed to be the
> next
> > best thing.
> >
> > Also, is there anyway to create multiple uniqe sessions? I seem to
> remember
> > that there is a way to do this using ASP/VBScript, but I can't seem to
do
> > this same thing in Java.
> >
> > thanks,
> >
> > Aaron
> >
>
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to