Re: loading a singleton class in jsp

2002-02-21 Thread David M. Karr

> "Michael" == Michael Buenaventura <[EMAIL PROTECTED]> writes:

Michael> Hi, I'm using struts framework and I was trying to load a singleton class
Michael> that will hold my dropdown list of state in my jsp.
Michael>  class="com.blah.StateLookup.getInstance();"/>
Michael> StateLookup is a singleton class.

Michael> I'm using the  so that I can use these struts tag lib
Michael>   value="">
Michael> 
Michael> 
Michael>   

Michael> Am I doing it the wrong way? Your input will be greatly appreciated.

First of all, it appears that you hit "Reply" when you wrote this note.  If you
have a new note to write, don't use "Reply".  Many mail clients can thread
notes with the original note.  If you write a new note as a Reply to another
note, it will often get lost.

On your issue, you're misunderstanding how "jsp:useBean" and the "class"
attribute work.  The value of the "class" attribute is the fully-qualified name
of a class.  You can't specify a class and a method, or any variation.  The
given class will be used to call the constructor to create an instance of the
class.  You can't use singletons like this.

However, if you let "jsp:useBean" create the instance of the class and place it
into session scope, you get essentially the same behavior.  You might even
consider using "application" scope.

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




loading a singleton class in jsp

2002-02-20 Thread Michael Buenaventura

Hi, I'm using struts framework and I was trying to load a singleton class
that will hold my dropdown list of state in my jsp.

StateLookup is a singleton class.


I'm using the  so that I can use these struts tag lib
 


  


Am I doing it the wrong way? Your input will be greatly appreciated.

Mike



--
To unsubscribe, e-mail:   
For additional commands, e-mail: