There are couple of ways to do so:
- Send a HTTP request
To invoke a servlet that requires authentication, in addition to creating the URL object, you need to pass authentication cookies too.
URL url = new URL("http://blah");
URLConnection con = url.openConnection();
con.setRequestProperty("Cookie", request.getHeader("Cookie"));
con.connect();
- RequestDispatcher
- Send a redirect