DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Thread: servlets

  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




Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links