How can i set up Tomcat so it processes *.asp files as JSP?

A

arub11

Hi All,

In one of our Web Applications, we do have URL(s) which end with .ASP
extensions such as the following:
http://www.webcommerce.com/display.asp

But we would like if those URL(s) end, with .JSP extensions, because
when click to the link above,
it should map to JSP file, called display.jsp.

My question is: How can we configure Apache's httpd.conf file, so that
it can convince tomcat, to consider all URL(s) ending with .ASP
extensions as .JSP files?

Thanks!
 
M

Manish Pandit

Tomcat is a servlet container that runs JSPs and servlets. ASP is
Active Server Pages, meant to be run under IIS. Renaming extentions
will not automatically convert ASP code into JSP if that is what you
want.

What do you mean by when you click on a .asp it should map to a .jsp?
Do you have JSPs with extension .asp sitting on your server ?

-cheers,
Manish
 
M

Mike Beaty

Are your .asp files really JSPs? If so, you can map ALL .asp
extensions to act like JSPs using the following:
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.asp</url-pattern>
</servlet-mapping>

If your .asp files are really ASPs, you'd need something like iASP to
get them to work in a J2EE container.

I think the answer you are looking for is outside of httpd.conf in
Apache and in your servlet container. I'm not sure what app server you
are using, but you would want to add that servlet-mapping to the
default web.xml file for that app server...the location of this file
varies by product.

-Mike
 
M

Mike Beaty

Are your .asp files really JSPs? If so, you can map ALL .asp
extensions to act like JSPs using the following:
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.asp</url-pattern>
</servlet-mapping>

If your .asp files are really ASPs, you'd need something like iASP to
get them to work in a J2EE container.

I think the answer you are looking for is outside of httpd.conf in
Apache and in your servlet container. I'm not sure what app server you
are using, but you would want to add that servlet-mapping to the
default web.xml file for that app server...the location of this file
varies by product.

-Mike
 
A

arub11

Manish said:
Tomcat is a servlet container that runs JSPs and servlets. ASP is
Active Server Pages, meant to be run under IIS. Renaming extentions
will not automatically convert ASP code into JSP if that is what you
want.

What do you mean by when you click on a .asp it should map to a .jsp?
Do you have JSPs with extension .asp sitting on your server ?

-cheers,
Manish

Hi Manish,

I think I confused you! But let's me make it simple!

On my Apache/Tomcat Server, I only have JSP files, off course, all
ending with the .jsp extension.

So, my problem is that I must enter the URL ending with .asp extension,
in the Internet explorer Browser's address, to login to that JSP Web
Application.

For example to access the following login.jsp page, in my Apache/Tomcat
Server, I would have to enter like this: http://localhost/login.asp,
instead of http://localhost/login.jsp

Thanks for your help!
 
A

arub11

Mike said:
Are your .asp files really JSPs? If so, you can map ALL .asp
extensions to act like JSPs using the following:
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.asp</url-pattern>
</servlet-mapping>

Mike, I think you kind of understood my question! Yes, I tried your
suggestion few days ago, it's not working! It seems to be a half of
the solution. The other half is that Apache's httpd.conf needs to be
configured, to make it work!

To respond to your question, yes all my files are JSP files ending with
..jsp extension, off course! See my response to Manish!

I am running Apache and Tomcat in my Window 2000 Server!

Thanks for your help!
 
S

Simon Brooke

in message <[email protected]>,
Hi All,

In one of our Web Applications, we do have URL(s) which end with .ASP
extensions such as the following:
http://www.webcommerce.com/display.asp

But we would like if those URL(s) end, with .JSP extensions, because
when click to the link above,
it should map to JSP file, called display.jsp.

My question is: How can we configure Apache's httpd.conf file, so that
it can convince tomcat, to consider all URL(s) ending with .ASP
extensions as .JSP files?

This is a job for mod_rewrite: damned cool voodoo.
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

That way you can map '.asp' onto '.jsp' so either will work.
 
M

Mark Space

So, my problem is that I must enter the URL ending with .asp extension,
in the Internet explorer Browser's address, to login to that JSP Web
Application.

Maybe this is a noobie question, but I'm darn curious:

*WHY* do you have to enter your login as http://example.com/login.asp ?
Is there some reason IE rejects anything ending in .jsp?
 
A

arub11

Mark said:
Maybe this is a noobie question, but I'm darn curious:

*WHY* do you have to enter your login as http://example.com/login.asp ?
Is there some reason IE rejects anything ending in .jsp?

Mark, that URL ending with .ASP extenstion is hardcoded in a different
application and I can't change it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,145
Latest member
web3PRAgeency
Top