Thursday, April 28, 2011

servlet to servlet calling problems

Currently I am working on the project which was based on JAVA coding. Basically it involves the servlets coding and passing the control from servlet to servlet. I came across some problems when I wanted to call one servlet from another.

1. check the client http request type i.e whether it is GET/POST etc.. Change the method type of the JAVA code as per the request type.

2.  use sendRedirect() only when you want to call the servlet on some another server

3. use forward() when other servlet is on the same server

4. find the type of client who is initiating the request i.e. is the request initiated from Web Browser or some external code like .jsp/.php etc. Because, there are some cases like Common Gateway Interface codes which are written in .jsp and they might not respond to sendRedrect statements.

5. check the role manager rights assigned to the servlets from the web server (e.g Tomcat)  

No comments:

Post a Comment

PROFILE

My photo
India
Design Engineer ( IFM Engineering Private Limited )

Followers