Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
arub11@yahoo.com - 11 Oct 2006 01:21 GMT
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!
Manish Pandit - 11 Oct 2006 03:53 GMT
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
arub11@yahoo.com - 11 Oct 2006 16:48 GMT
> Tomcat is a servlet container that runs JSPs and servlets. ASP is
> Active Server Pages, meant to be run under IIS. Renaming extentions
[quoted text clipped - 6 lines]
> -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!
Manish Pandit - 11 Oct 2006 18:04 GMT
Thanks for the clarifications!

Did you take a look at mod_alias in apache, specially the RedirectMatch
directive? From the documentation it looks like something you can use
in this situation.

http://httpd.apache.org/docs/1.3/mod/mod_alias.html

-cheers,
Manish
arub11@yahoo.com - 12 Oct 2006 18:00 GMT
> Thanks for the clarifications!
>
[quoted text clipped - 6 lines]
> -cheers,
> Manish

Manish, thanks! I will take a look, it seems Simon provided a solution
for my task too!
Mark Space - 12 Oct 2006 00:32 GMT
> 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?
arub11@yahoo.com - 12 Oct 2006 07:20 GMT
> > 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
[quoted text clipped - 4 lines]
> *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!
Mike Beaty - 11 Oct 2006 16:33 GMT
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
On Oct 10, 8:21 pm, aru...@yahoo.com wrote:
> Hi All,
>
[quoted text clipped - 10 lines]
>
> Thanks!
Mike Beaty - 11 Oct 2006 16:38 GMT
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

On Oct 10, 8:21 pm, aru...@yahoo.com wrote:
> Hi All,
>
[quoted text clipped - 10 lines]
>
> Thanks!
arub11@yahoo.com - 11 Oct 2006 17:12 GMT
> 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!
Simon Brooke - 11 Oct 2006 23:52 GMT
> Hi All,
>
[quoted text clipped - 9 lines]
> 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.

Signature

simon@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/

       ;; L'etat c'est moi                     -- Louis XVI
       ;; I... we... the Government            -- Tony Blair

arub11@yahoo.com - 12 Oct 2006 09:36 GMT
> > Hi All,
> >
[quoted text clipped - 20 lines]
>         ;; L'etat c'est moi                     -- Louis XVI
>         ;; I... we... the Government            -- Tony Blair

Simon,

I think this may be the solution! I will try it and see. Thanks a bunch!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.