[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


servlet filters and  multiple applications in tomcat

Posted on 2004-08-10
Medium Priority
Last Modified: 2013-11-24
Is there a way to configure tomcat so i can reference one application from within another?  specifically I want a servlet filter to catch a request to a resource in tomcat_home/webapps/app_A and have it handled by a servlet in tomcat_home/webapps/app_B.

Any ideas?

Question by:deriggi
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

beermequik earned 500 total points
ID: 11777142
You could forward the request to app_B
//in the doGet or doPost of servet in App-a

String returnUrl =
  response.encodeUrl(/* full url path to servlet in App-B */);
ServletConfig servletConfig = getServletConfig();
ServletContext context = servletConfig.getServletContext();
RequestDispatcher dispatcher = context.getRequestDispatcher( returnUrl );
dispatcher.forward(request, response);

// that should do it.

Assisted Solution

kumvjuec earned 500 total points
ID: 11786808
you would want to use response.encodeURL instead of response.encodeUrl
The later is deprecated :D

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn different types of Android Layout and some basics of an Android App.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Simple Linear Regression

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question