• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to call servlet class from an action class?

 
Ankit Gandhi
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i want to call a method defined in a servlet class which extends HttpServlet inside the doView() method of an action class which extengs Generic Portlet.
we can''t create the object of that servlet class in action class and call its method.
please help

TIA
Manisha
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't.

Servlets are not meant for this.
Instead, move your method to a bean or a plain old Java object (POJO) that can instanciated and have its methods called from any Java class; servlet or otherwise.
 
Ankit Gandhi
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actully problem is that i want to use getKookies() (C replaced with K) in the doView() method of an action class.

And since doView() method can take only two arguments RenderRequest and RenderResponse and with their objects we can�t use the getKookies()(C replaced with K) method.
getKookies() (C replaced with K)gives the error if we call it with the object of RenderRequest because it is undefined for the type RenderRequest. and getKookies() ((C replaced with K) is defined for HttpServletRequest.
Please tell me with which object I can call the getKookies() (C replaced with K)method?
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic