• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there a way to know all the webapp's inside a tomcat

 
vishwanath nadimpally
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to post this question before, but I asked the wrong question before.This is the correct set of questions that I want to ask.

1) Is there a way to get the names of all the web-apps inside a server (say tomcat) and all the contexts inside of each webapp?
(say ex. "web-app1/context1/" etc.)?

2)After '1' is done, can I have a filter which see's a request of the form "web-app1/context1/path1/*" and redirects it to
"/web-app2/context2/path2/xyz.jsp" ?

3) If '2' is possible then does it make any difference if 'source web-app' and 'target web-app' are on different servers(say different tomcats).

This may not be a routine scenario, but I am trying to do something like this. So please help me out.
 
Manesh Kumar
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure of first question

I think 2nd question possible



My assumption is web-app2 is another application in the same server and /context2/path2/xyz.jsp is path to jsp file.

3) Yes it does make difference. Within the server we can get servelt context of another web application but not from another server.

You might need to sendRequest changing the URL to another server.

Hope this helps.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#1) That's possible using Tomcat-internal APIs like the following, which tries to find a specific context.


#2) I don't see a strong connection to #1. You can always filter the request, and redirect or forward based on its properties. Maybe you're in a situation where the redirect target differs depending on which web apps are available?

#3) It makes a difference insofar as you can do a request dispatch on the same server (if the web apps are properly privileged). To a different server you'd have to do a client redirect.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is rather Tomcat-specific, so it's been moved to the Tomcat forum.
 
vishwanath nadimpally
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dilip Kumar Jain:
I am not sure of first question

I think 2nd question possible



My assumption is web-app2 is another application in the same server and /context2/path2/xyz.jsp is path to jsp file.

3) Yes it does make difference. Within the server we can get servelt context of another web application but not from another server.

You might need to sendRequest changing the URL to another server.

Hope this helps.


Yes #2 is possible but remember it's not a forward its a redirect and the redirection is being done to a different server. So is '#2' still possible?
 
vishwanath nadimpally
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

#2) I don't see a strong connection to #1. You can always filter the request, and redirect or forward based on its properties. Maybe you're in a situation where the redirect target differs depending on which web apps are available?

#3) It makes a difference insofar as you can do a request dispatch on the same server (if the web apps are properly privileged). To a different server you'd have to do a client redirect.[/QB]


Yes, you are correct on 2 .My target is not always the same.It depends on the web app.So I guess my next question is if its not a same target always would I have to configure the filter for the incoming request on the target as well?

and you are correct about what I want to do on #3.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic