Special Considerations for Servlet Virtualization

Document ID : KB000010563
Last Modified Date : 14/02/2018
Show Technical Document Details

Special considerations must be taken when virtualizing servlets and similar java programs.


Prerequisite: The DevTest agent must be installed prior to capturing transactions. If you need assistance installing the DevTest agent, please open a support ticket.

All supported DevTest platforms.

The topmost servlet class must extend the HttpServlet class and contain at least one method that looks something like this:
public void <method name>(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {

do work


Where <method name> is a standard method found in the HttpServlet Class.
Examples: doGet, doPost, doPut, doDelete, etc…
All of these methods have the same structure.
Return: void
Input parameters:
          HttpServletRequest: contains the request information
          HttpServletResponse: a structure that is modified and later processed by a web server like Tomcat.

The work done in these methods will modify the HttpServletResponse. This modified structure is passed back to the calling class and the Web page is rendered or other work performed.

If you attempt to capture this method and build a Virtual Service with the DevTest java agent, you will run into issues and the expected web page will not be rendered. Since the agent knows the web page is rendered elsewhere it will not capture this java call.

This call can be captured at the protocol level by using setting the http protocol to “full data” in the portal.
The java calls below this class can be captured using the normal java class/method capture procedures.

Additional Information:

Not applicable.