How is your servlet communicating with the foreign one ... URL or HttpURLConnection or something like that? Look in the
doc or on Google for a "follow forward" option that makes one of those (forget which) automatically follow any forward headers sent back by the foreign servlet. I've set this to true before (maybe the default) but never really tested how well it works.