Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet method call

 
Yatendra Varshney
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suppose there is a method defined in servlet A and I want to call this method in servlet B.
 
Yatendra Varshney
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell me if have any solution.

Thanks in advance.

Regrad,
Yatendra
 
sven studde
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Declare the method as static in A, then in B use the class name 'A' to call the method?

2) Declare the method as a regular method in A, and then inside B create an A object and use it to call the method?
[ October 30, 2006: Message edited by: sven studde ]
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or You can call the public method of Servlet A by calling Servlet A inside Servlet B.

please follow this link for more help
Example of Calling Servlets from Servlets
 
Yatendra Varshney
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Saif to clear picture to me.

- Yatendra
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic