By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,032 Members | 825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,032 IT Pros & Developers. It's quick & easy.

url mapping

P: n/a
Hi there,

In web.xml, I know it's possible to do path mapping:

<path-mapping url-pattern="/aaa/*" real-path="C:\TEMP\"/>

So a call to myserver.com/mywebapp/aaa will redirect to c:\temp.

Is it possible to do the same but with a URL?

e.g.:
<kind-of-url-mapping url-pattern="/bbb/*" real-url="http://www.google.com" />

Thanks!

Frank
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Frank wrote:
In web.xml, I know it's possible to do path mapping:

<path-mapping url-pattern="/aaa/*" real-path="C:\TEMP\"/>
I think you are mistaken. This tag is not part of the DTD for the Servlet
x.y deployment descriptor, at least not up until version 2.3. See for
yourself: <http://java.sun.com/dtd/web-app_2_3.dtd>
Is it possible to do the same but with a URL?

e.g.:
<kind-of-url-mapping url-pattern="/bbb/*" real-url="http://www.google.com"
/>


Here is one way of doing it:

(1) Create a servlet that will redirect incoming requests to
<http://www.google.com>.

(2) Define a servlet mapping in web.xml which maps "/bbb/*" to the servlet
you just created.

--
Jonas Kongslund
Jul 17 '05 #2

P: n/a
Your right, path mapping is not part of actual DTD. Actually it's a
node added by Resin container.

I will write a servlet unless there is no possible configuration.

Thank you Jonas.
Jonas Kongslund <do**@mail.me.at.all> wrote in message news:<Mb****************@news.get2net.dk>...
Frank wrote:
In web.xml, I know it's possible to do path mapping:

<path-mapping url-pattern="/aaa/*" real-path="C:\TEMP\"/>


I think you are mistaken. This tag is not part of the DTD for the Servlet
x.y deployment descriptor, at least not up until version 2.3. See for
yourself: <http://java.sun.com/dtd/web-app_2_3.dtd>
Is it possible to do the same but with a URL?

e.g.:
<kind-of-url-mapping url-pattern="/bbb/*" real-url="http://www.google.com"
/>


Here is one way of doing it:

(1) Create a servlet that will redirect incoming requests to
<http://www.google.com>.

(2) Define a servlet mapping in web.xml which maps "/bbb/*" to the servlet
you just created.

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.