Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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!