• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

how to call servlet class from an action class?  RSS feed

 
Greenhorn
Posts: 27
  • 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
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 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
  • 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?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!