Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

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?
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!