servlets


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: servlets

Hybrid View

  1. #1
    matt Guest

    servlets


    Concerning servlets,

    If I have 2 different servlets, one called Print and another called List,
    where Print prints a specified file (ie. http://localhost:33140/Print/test.txt)
    and List prints out the names of files called from the Print servlet. How
    do I share the data from Print into List?

    So far, I've tried to store the file names in a Vector in the Print servlet
    and when List is called (ie. http://localhost:33140/List), I try to instantiate
    an instance of Print (in the run method) and call a getFiles function which
    returns the Vector of file names previously mentioned. However, it appears
    to create a new instance of Print with an empty Vector and not use the existing
    one.

    Any suggestions?

    ~Matt

  2. #2
    Paul Clapham Guest

    Re: servlets

    To share data between servlets you put it into (and take it out of) a
    Session object.

    PC2

    "matt" <mrodgers@wam.umd.edu> wrote in message
    news:3bbe1838$1@news.devx.com...
    >
    > Concerning servlets,
    >
    > If I have 2 different servlets, one called Print and another called List,
    > where Print prints a specified file (ie.

    http://localhost:33140/Print/test.txt)
    > and List prints out the names of files called from the Print servlet. How
    > do I share the data from Print into List?
    >
    > So far, I've tried to store the file names in a Vector in the Print

    servlet
    > and when List is called (ie. http://localhost:33140/List), I try to

    instantiate
    > an instance of Print (in the run method) and call a getFiles function

    which
    > returns the Vector of file names previously mentioned. However, it

    appears
    > to create a new instance of Print with an empty Vector and not use the

    existing
    > one.
    >
    > Any suggestions?
    >
    > ~Matt




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center