how can i get a servlet instance from ServletPool

2004-03-01 Thread Edson Alves Pereira
Hello dudes, is there a way to get a servlet instance from Tomcat´s
pool?   Is there a replacement to getServletContext( ).getServlet( )?

Regards,
Edson


RE: how can i get a servlet instance from ServletPool

2004-03-01 Thread Shapira, Yoav

Howdy,

   Hello dudes, is there a way to get a servlet instance from Tomcat´s
pool?  Is there a replacement to getServletContext( ).getServlet( )?

As always, there's a way.  But is it portable/reliable/advisable?  No, no, and no.  
Was there a reason getServlet was deprecated?  Sure.

Why do you want to do this?

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: how can i get a servlet instance from ServletPool

2004-03-01 Thread Edson Alves Pereira
I have one servlet that make a SQL query and as result build a HTML
table to display in user´s browser, i´d like to create a report servlet to
use servlets like my query-servlet to print ( in our project report-servlets
are a little different from our query-servlets ). Then i created this
report-servlet and i was willing to use query-servlet´s methods to reuse its
features. To solve that problem i implemented a static method in
query-servlet to enable report-servlet to use query-servlet´s ResultSet,
basically a build a static method to make two servlets share the same
functionalities, is this right?


 --
 De:   Shapira, Yoav[SMTP:[EMAIL PROTECTED]
 Responder:Tomcat Users List
 Enviada:  segunda-feira, 1 de março de 2004 11:08
 Para: Tomcat Users List
 Assunto:  RE: how can i get a servlet instance from ServletPool
 
 
 Howdy,
 
  Hello dudes, is there a way to get a servlet instance from Tomcat´s
 pool?Is there a replacement to getServletContext( ).getServlet(
 )?
 
 As always, there's a way.  But is it portable/reliable/advisable?  No, no,
 and no.  Was there a reason getServlet was deprecated?  Sure.  
 
 Why do you want to do this?
 
 Yoav Shapira
 
 
 
 This e-mail, including any attachments, is a confidential business
 communication, and may contain information that is confidential,
 proprietary and/or privileged.  This e-mail is intended only for the
 individual(s) to whom it is addressed, and may not be saved, copied,
 printed, disclosed or used by anyone else.  If you are not the(an)
 intended recipient, please immediately delete this e-mail from your
 computer system and notify the sender.  Thank you.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


RE: how can i get a servlet instance from ServletPool

2004-03-01 Thread Mike Curwen
That sort of coding is probably not the way to go about solving this
particular problem (how to re-use all the work you've done in the other
servlet). 

But assuming you leave everything as is, the question I come up with
is: Why do you need an instance of a servlet, if the method you want to
call has been made static?

 -Original Message-
 From: Edson Alves Pereira [mailto:[EMAIL PROTECTED] 
 Sent: Monday, March 01, 2004 11:26 AM
 To: 'Tomcat Users List'
 Subject: RE: how can i get a servlet instance from ServletPool
 
 
   I have one servlet that make a SQL query and as result 
 build a HTML table to display in user´s browser, i´d like to 
 create a report servlet to use servlets like my query-servlet 
 to print ( in our project report-servlets are a little 
 different from our query-servlets ). Then i created this 
 report-servlet and i was willing to use query-servlet´s 
 methods to reuse its features. To solve that problem i 
 implemented a static method in query-servlet to enable 
 report-servlet to use query-servlet´s ResultSet, basically a 
 build a static method to make two servlets share the same 
 functionalities, is this right?
 
 
  --
  De: Shapira, Yoav[SMTP:[EMAIL PROTECTED]
  Responder:  Tomcat Users List
  Enviada:segunda-feira, 1 de março de 2004 11:08
  Para:   Tomcat Users List
  Assunto:RE: how can i get a servlet instance from ServletPool
  
  
  Howdy,
  
 Hello dudes, is there a way to get a servlet instance 
 from Tomcat´s
  pool?  Is there a replacement to getServletContext( 
 ).getServlet(
  )?
  
  As always, there's a way.  But is it 
 portable/reliable/advisable?  No, 
  no, and no.  Was there a reason getServlet was deprecated?  Sure.
  
  Why do you want to do this?
  
  Yoav Shapira
  
  
  
  This e-mail, including any attachments, is a confidential business 
  communication, and may contain information that is confidential, 
  proprietary and/or privileged.  This e-mail is intended only for the
  individual(s) to whom it is addressed, and may not be 
 saved, copied, 
  printed, disclosed or used by anyone else.  If you are not the(an) 
  intended recipient, please immediately delete this e-mail from your 
  computer system and notify the sender.  Thank you.
  
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: how can i get a servlet instance from ServletPool

2004-03-01 Thread Edson Alves Pereira
No, i made it static `cause i couldn´t get servlet instance in
another servlet, that´s solved my problem, but i´d like to know if is this
the best way to solve problems like that?

 --
 De:   Mike Curwen[SMTP:[EMAIL PROTECTED]
 Responder:Tomcat Users List
 Enviada:  segunda-feira, 1 de março de 2004 14:34
 Para: 'Tomcat Users List'
 Assunto:  RE: how can i get a servlet instance from ServletPool
 
 That sort of coding is probably not the way to go about solving this
 particular problem (how to re-use all the work you've done in the other
 servlet). 
 
 But assuming you leave everything as is, the question I come up with
 is: Why do you need an instance of a servlet, if the method you want to
 call has been made static?
 
  -Original Message-
  From: Edson Alves Pereira [mailto:[EMAIL PROTECTED] 
  Sent: Monday, March 01, 2004 11:26 AM
  To: 'Tomcat Users List'
  Subject: RE: how can i get a servlet instance from ServletPool
  
  
  I have one servlet that make a SQL query and as result 
  build a HTML table to display in user´s browser, i´d like to 
  create a report servlet to use servlets like my query-servlet 
  to print ( in our project report-servlets are a little 
  different from our query-servlets ). Then i created this 
  report-servlet and i was willing to use query-servlet´s 
  methods to reuse its features. To solve that problem i 
  implemented a static method in query-servlet to enable 
  report-servlet to use query-servlet´s ResultSet, basically a 
  build a static method to make two servlets share the same 
  functionalities, is this right?
  
  
   --
   De:   Shapira, Yoav[SMTP:[EMAIL PROTECTED]
   Responder:Tomcat Users List
   Enviada:  segunda-feira, 1 de março de 2004 11:08
   Para: Tomcat Users List
   Assunto:  RE: how can i get a servlet instance from ServletPool
   
   
   Howdy,
   
Hello dudes, is there a way to get a servlet instance 
  from Tomcat´s
   pool?Is there a replacement to getServletContext( 
  ).getServlet(
   )?
   
   As always, there's a way.  But is it 
  portable/reliable/advisable?  No, 
   no, and no.  Was there a reason getServlet was deprecated?  Sure.
   
   Why do you want to do this?
   
   Yoav Shapira
   
   
   
   This e-mail, including any attachments, is a confidential business 
   communication, and may contain information that is confidential, 
   proprietary and/or privileged.  This e-mail is intended only for the
   individual(s) to whom it is addressed, and may not be 
  saved, copied, 
   printed, disclosed or used by anyone else.  If you are not the(an) 
   intended recipient, please immediately delete this e-mail from your 
   computer system and notify the sender.  Thank you.
   
   
   
  -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


RE: how can i get a servlet instance from ServletPool

2004-03-01 Thread Erik Price

--- Edson Alves Pereira [EMAIL PROTECTED] wrote:
   No, i made it static `cause i couldn´t get servlet instance in
 another servlet, that´s solved my problem, but i´d like to know if is
 this
 the best way to solve problems like that?

Doesn't it seem like you could refactor that functionality out into a
non-servlet Java class and then make use of that class from both
servlets?

I find it helpful to think of a servlet as little more than an event
handler for HTTP messages, and try to put all my real work into plain
old Java objects which are then utilized by servlets (or any other
place I need to use them).


Erik

__
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: how can i get a servlet instance from ServletPool

2004-03-01 Thread Edson Alves Pereira
Maybe i really should put those static methods in Java objects, in
that way will get easyer to share with other servlets. It´s plain to see,
you right.

 --
 De:   Erik Price[SMTP:[EMAIL PROTECTED]
 Responder:Tomcat Users List
 Enviada:  segunda-feira, 1 de março de 2004 14:54
 Para: Tomcat Users List
 Assunto:  RE: how can i get a servlet instance from ServletPool
 
 
 --- Edson Alves Pereira [EMAIL PROTECTED] wrote:
  No, i made it static `cause i couldn´t get servlet instance in
  another servlet, that´s solved my problem, but i´d like to know if is
  this
  the best way to solve problems like that?
 
 Doesn't it seem like you could refactor that functionality out into a
 non-servlet Java class and then make use of that class from both
 servlets?
 
 I find it helpful to think of a servlet as little more than an event
 handler for HTTP messages, and try to put all my real work into plain
 old Java objects which are then utilized by servlets (or any other
 place I need to use them).
 
 
 Erik
 
 __
 Do you Yahoo!?
 Get better spam protection with Yahoo! Mail.
 http://antispam.yahoo.com/tools
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]