tomcat :: Listener for my own class (global access to class)

hiI have one servlet with init() method which initialize object of myown class.that's ok if I use this object from only one servlet.but how change it - add Listener and have access to object from allservlets.moreover do not edit any of tomcat files, only project files.thanks
0
devphyl (26)
9/26/2007 8:28:19 PM
comp.lang.java.programmer 52324 articles. 0 followers. Post Follow

1 Replies
379 Views

Similar Articles

[PageSpeed] 27
devphylosoff <devphyl@gmail.com> said:>I have one servlet with init() method which initialize object of my>own class.>>that's ok if I use this object from only one servlet.>but how change it - add Listener and have access to object from all>servlets.Your init() places the object to application context, so it will beavailable through application context to all other servlets needing it;just take care that the servlet initializing this class is somethingthat it loaded on webapp startup (web.xml init-on-startup, if I recallcorrectly).-- Wolf  a.k.a.  Juha Laiho     Espoo, Finland(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V         PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++"...cancel my subscription to the resurrection!" (Jim Morrison)
0
Juha
9/29/2007 8:37:03 PM
Reply:
Similar Artilces:

SAP BO Online Training with free Demo class in USA | UK | INDIA | SINGAPORE | Australia | Canada
SAP BO online training is the foremost and spicy module and controlling mod= ule. Lots of users value more highly to dive into the venture for obtaining= SAP BO online training completely. This is often splendidly accepted as an= awfully hot and spicy section of SAP and many learners value more highly t= o endure its technical training. SAP BO online training is mostly preferred= by on job professionals because they can do the course from their home, ir= respective of where they are located, and at their flexi time. Some of the SAP BO online training Course topics that covered by o...

JTable will not listen!
HI, I would be gratefull for any suggestions that might clarify the following Problem: can't add a JTable to the listener list of a subclass of AbstractTableModel. In my programme I instatiate a DataTable and pass it to a JTable contructor, dataModel = new DataTable(); JTable jt = new JTable(dataModel); //following line may not be neccessary as //the JTable constructor should do this! dataModel.addTableModelListener(jt); where, public DataTable extends AbstractTableModel implements SomeOtherInterface; My objective it to relay remote events to the listeners of my DataTable, ie the JTa...

Derived Class Reference to Base Pointer
Hi, Can you please tell me how I can obtain a pointer to a base class from a variable which is a reference to a derived class. As an example, I have a variable which is a reference to a derived class (Manager)and I want obtain a pointer to the base class (Employee). Thank you for help. Pete class Employee { char* name; int age; int department; int salary; public: Employee(char* name); void print(); }; class Manager : public Employee { EmployeeList employees; public: Manager(char* name, Employee* people); void print(); }; ...

[TOMCAT] Tomcat crashes
Hi everybody, i'm in battle against Tomcat 4.0.6. Here's my server configuration: W2K Pro + j2sdk 1.4.1 + TOMCAT 4.0.6 + MyWebApp And Here's my problem: i've implemented a custom taglibrary that renders jsp pages in a layout environment. This is the code i use: <region: name="myname" page="mypage.jsp" /> so, if the page included trows an exception, it is caught by a System.out debug. But, sometimes Tomcat hangs without trowing an exception, i wait wait wait but it never throws an exception. First, Is there a method to have a powerful debug of w...

Overload set and get access in a hgsetget grandchild class
Hi, I have a little problem with the hgsetget class (in Matlab 2008b). Suppose two classes: classdef bar < hgsetget properties myProp end % ... other properties and methods end and: classdef foo < bar methods function set.myProp( h, val ) disp( 'myProp access' ); % ... other treatments h.myProp = val; end end % ... other properties and methods end This generates a MLint error: "The method SET.MYPROP does not refer a valid property name." I can't add a new property myProp in ...

Obtain class of Generic type? (how can I remove a Class<T> parameter)
I have some code (below) that does a custom conversion between types (namely from an Object type to some specific type). It is a prime candidate for Generics (to avoid the return value casts by the user), but there doesn't appear to be any way to get rid fo the Class<T> parameter -- that is, the type I wish still needs to be a formal parameter and not just the Generic Type. /** @param type - the type to conver to * @param obj - the obejct to convert */ static public <T> T asType( Class<T> type, Object obj ) throws Exception { if( type.equals( Number.class ) ) return typ...

A singleton lifespan in Tomcat
Hi! I have a singleton class that operates on a Tomcat server. When I start Tomcat, everything is fine, I have only one instance of the class. But, if I modify the web.xml file, per example, and the context is stopped then restarted, the instance I had in the first place isn't destroyed and continues to run, and another singleton is created when I call the getInstance() method of the singleton. How do I fix that? Here are some excerpts of my class: public class ConnectionPool { private static ConnectionPool instance = null; .. .. .. public synchronized static ConnectionPool getInsta...

Writing binary Data to MS-Access
Hi there, What data type (field type) do I need to chose within Microsoft Access 2003 to save an entire file in a BLOB-field. I didnt see a hint in the help file. Thanks Roger If this is a text file, then use the Memo field type Else use the LongBinary type -- With best regards, Mike Shkolnik E-mail: mshkolnik@scalabium.com WEB: http://www.scalabium.com "John Cool" <omsecnews@hispeed.ch> wrote in message news:cgt226$hhl$1@newshispeed.ch... > Hi there, > > What data type (field type) do I need to chose within Microsoft Access 2003 > to s...

Datastage Online Training with free Demo class in USA | UK | INDIA | SINGAPORE | Australia | Canada
Datastage Online Training by SAP Centre is the best opportunity for student= s. Because we are providing each and every topic about Datastage. It is als= o easy to learn and forms a good entry module for beginners. The course is = intended to be lucid, easy to follow not theoretical as are most of the cou= rses taught online. Datastage Online Training by SAP Centre is the best opp= ortunity for students. Datastage Online Training is one of the most in dema= nd data analysis module to build career.=20 =20 Some of the Datastage online training Course topics that covered by our pro= fess...

Listening for a key press while a mouse dragged is peformed.
I want to listen for a VK_ESCAPE during a mouse drag. I never thought this would be a problem initially, as I used a MouseMotionListener and a KeyListener. However I found that the key typed did not work, nor did it's other two methods. (I added all three of them as adapters, so I didn't forget that part! =) I researched through these Java groups and found a way to use KeyStroke in combination with other techniques to listen for events. I tried an older (deprecated, I believe) way of doing key listening and finally I used an input and action map. These last two worked, ...

Pyton re module and POSIX equivalence classes
Is Python supposed to support POSIX "equivalence classes"? I tried the following in Py2 and Py3: >>> re.sub('[[=3Da=3D]]', 'A', 'a=C3=A1=C3=A0=C3=A3=C3=A2=C3=A4', re.U) 'a=C3=A1=C3=A0=C3=A3=C3=A2=C3=A4' which suggests that it doesn't (I would have expected "AAAAAA" as the result). Is there a way to get this behavior? I found that perl knows about them but treats them as an exception for now[1]. Supposedly GNU awk (and other GNU POSIXish tools) recognize character classes, as does vim. Thanks, -tkc ...

Help! I can't access my USB HD anymore...
I've been using a Seagate Internal HD connected to an IDE to USB cable as a External USB HD on my Windows XP machine. Yesterday I changed the Volume label and now the computer don't even recognize the USB device at all. I found out today that I changed the Volume Label to 12 characters. Normally Volume Label is limited to 11 characters. How do I get my computer to recognize the HD? Thanks for your help! --------------= Posted using GrabIt =---------------- ------= Binary Usenet downloading made easy =--------- -= Get GrabIt for free from http://www.shemes.com/ =-...

Access to IPSec VPN through Netscreen-10 fw
I've got a situation where about 3 or 4 users will need to access an IPSec VPN. They're all coming from a LAN which is behind a Netscreen-10 firewall which is using NAT. The device they're trying to connect to is a Netgear FVL328. I don't think NAT-T is available on the Netgear box, unless there's a new firmware out that I'm not aware of which supports it (which could very well be...) I thought about setting up a LAN-to-LAN vpn, but it looks like that idea might be hard to sell to the remote side. I don't know if they'd be open to replacing their VPN device wit...

Listening to Radio over Internet
Linux SuSE 9.2 Browser: Mozilla Firefox Stations: Live365 Medion 1011 Computer Model (if you want to see details on machine). Went to Live365 to see if I could listen to Internet Radio. I got this warning that the bandwith was 0, and 56k was required. There was an option to "Play Anyway" so I did. Played over the Cable Modem, and it actually works ... better then windows XP on the same machine. It plays without any hickups (XP Pro hickups) and the sound is clearer. TAB wrote: > Linux SuSE 9.2 > Browser: Mozilla Firefox > Stations: Live365 > Medion 1011 Computer...

During boring classes, texting is the new doodling [telecom]
During boring classes, texting is the new doodling By Michael Rubinkam Associated Press / November 26, 2010 WILKES-BARRE, Pa.-When his professors drone, Dan Kautz whips out his phone. Kautz, a senior at Wilkes University, might send a text message to someone across the room -- "I can't wait to get out of here" -- or make plans with his roommates. He's become so adept at texting during class that he can tap out a message without even looking at the screen, making it appear as if he's paying attention to the instructor when he's really chatting w...

UML: Entity classes and correct relational notation ?
Hi, may I begin here... I am thinking about how to model entity classes and their relations correctly. One book describes relations using associations and their cardinality. I found this in the german book 'Modellgetriebene Softwareentwicklung' on page 50: ISBN 978-3-939084-11-2 (translated: Modeldriven software development) The other book describes the relation with directional associations 'Patterns of enterprise application architecture' on page 129: ISBN 0-321-12742-0 I have used the aggregation notation to describe the relation between my classes. Maybe I have it from...

Google Listen
Google Listen, a Podcast Manager for Android August 21, 2009 "As you probably noticed, Google releases many interesting services as Android applications and some of them are part of Google Labs: an application that records GPS tracks, a star map, a directory of points of interest. The latest release is an application titled Google Listen, a player for podcasts." http://googlesystem.blogspot.com/2009/08/google-listen-podcast-manager-for.html Google Listen "Listen from Google Labs brings podcasts and web audio to your Android-powered device. It lets you search, su...

SPECIAL INVITE: Global Embedded Conference India (May 21, Bangalore) #3
Hi How are you doing? Embedded software developers are facing rising design complexity and ever greater time to market pressure, while being required to achieve results using existing resources. Competitive pressure demands that new products be released in less time and at lower cost. How do we deal with this increasing market competition? The SiliconIndia Global Embedded Developer Conference India focuses on systems that are actually deployed in commercial industry, military or other production environments, automotive, avionics, telecommunications, industrial control, aerospace, co...

derived class and virtual function
In Stanley Lippman's 'C++ Primer Fourth Edition', in page 564, the following is mentioned: "A virtual function in the derived class can return a reference or pointer to a class that is PUBLICLY derived from the type returned by the base class function." I am unable to understand this sentence. Kindly explain it with program sample. Thanks V.Subramanian subramanian100in@yahoo.com, India <subramanian100in@yahoo.com>, on 13/08/2010 01:29:13, wrote: > In Stanley Lippman's 'C++ Primer Fourth Edition', in page 564, the > following is me...

Tomcat
I have a strange problem with Tomcat 5.0.16. This is (currently) a sandalone installation, with the intention eventually of linking to apache with (presumably) JK2. The system is running RedHat 9. The problem is that the default ..../webapps/ROOT/index.jsp will not compile. This is not a compilation error. The same .jsp source in any other location on the server compiles itself fine, but when in its default location I always see the standard default page, no matter what I do to the index.jsp file. If this page behaved as normal, I would expect a java source and class to be gen...

How to Lock and Hide Access Tables?
Hello I have a runtime application created with Access 2000 that I want to distribute. I would like to lock and/or hide some tables in this application so that they could only be modified by the application itself and not be available for modification by someone opening the application with a version of Microsoft Access. I would like these tables to behave like a System object. Is this possible? Thanks G.Gerard Implement user level security on your database, and change your data access strategy to use RWOP queries instead of tables. Then, you can remove all access to tables. D...

Economist Global Agenda for Plucker users who are interested...
Will be updated throughout the month... if anyone shows interest, that is. See my matching post in alt.binaries.warez.palmpilot for the binary file, which i dare not post in here, for fear of the ensuing flame war. "Henry's Cat" <HenrysCat@hotmail.com> wrote in message news:faolqvo032v5bd01fjod40gt36eo5900ce@4ax.com... > Will be updated throughout the month... if anyone shows interest, that > is. > > See my matching post in alt.binaries.warez.palmpilot for the binary > file, which i dare not post in here, for fear of the ensuing flame > war....

ZoneAlarm
Both of my browsers (IE and Opera) have a long lag time on the 1st HTML access after startup. This does NOT happen for POP3 or SMTP mail server access. The lags are usually in the range of 1.5 minutes to 2.5 minutes, but after one browser has made a successful connection, subsequent tries with either browser go normally. The OS is Windows XP Pro, and this has been going on since I installed ZoneAlarm Internet Security Suite 2007. If I disable ZoneAlarm right after startup, the 1st HTML access with either browser goes normally. ZoneAlarm is doing something which causes the long delay on the ...

Property in derived class
If I have a property in a derived class, it is difficult to override the get and set functions: the property's function object had early binding, whereas the overriden method was bound late. This was previously discussed: http://groups.google.com/group/comp.lang.python/browse_thread/thread/e13a1bd46b858dc8/9d32049aad12e1c1?lnk=gst#9d32049aad12e1c1 Could someone demonstrate how to implement the proposed solutions that allow the property to be declared in the abstract base class, and refer to a get function which is only implemented in derived classes? Thanks, Joseph Joseph Turian wr...

RMI
Hello!I am writing a little RMI application, where the server has access to a database (sort of persistence layer), and the client sends search terms to it over RMI.The server loads the answer from the database into a JavaBean object that is downloaded over the network so that the client can extract the results from it. The javabean implements an interface with all the exposed methods (get and set).My question: Can RMI download the class definition from the server at run-time, or do I need to have the class definition available at the client as a .class file.When I try to compile and run the c...