wood burning stoves*
The moose likes Tomcat and the fly likes Is there a way to know all the webapp's inside a tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Is there a way to know all the webapp Watch "Is there a way to know all the webapp New topic
Author

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

vishwanath nadimpally
Ranch Hand

Joined: Jan 25, 2005
Posts: 116
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

Joined: Mar 21, 2006
Posts: 94
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.


Manesh
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39535
    
  27
#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.


Ping & DNS - updated with new look and Ping home screen widget
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

This is rather Tomcat-specific, so it's been moved to the Tomcat forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
vishwanath nadimpally
Ranch Hand

Joined: Jan 25, 2005
Posts: 116
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

Joined: Jan 25, 2005
Posts: 116

#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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there a way to know all the webapp's inside a tomcat
 
Similar Threads
updating web app
How to replicate sessions between two web applications on the same tomcat?
Multiple apps in Tomcat
multiple apps pointing so same docbase locking the log files from rolling
inter-application communication between ear files