Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need my servlet to be compatible with its scriplet ancestor  RSS feed

 
Joe Areeda
Ranch Hand
Posts: 334
2
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A little background:

A couple of years ago I started my first Java Web Application. It was to be a prototype to demonstrate the feasibility of augmenting a big Matlab application with a little Java web app.

I made a rookie mistake and used a sciplet called index.jsp which basically just called a java app which I'm trying to correct by implementing a real servlet.

This app became popular as I was learning and I responded to requests for RESFful services. Now there are maybe a few thousand extenal links to images in the database and a handful of other web sites than embed requests.

The problem:

The old way of doing things had uri's like https://example.com/viewer?act=getimg&id=1234

Now the servlet has uri's liek https://example.com/viewer/ldvw?act=getimg&id=1234

I need to be compatible with the old uri's but I can't seem to figure out how.

One more thing is that the app uses Apache as a front end to Tomcat.

I might be able to get the people to change the calls in the other web sites but if I invalidate the static links in wikis and webpages my name will be Mud and the app will not be used.

I would appreciate any suggestions on how to do this.

Thanks,
Joe
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The easiest might be to use the mod_rewrite module in the Apache. If that's the only pattern to be adapted then that should be quite easy.

An alternative if you want to do it in the Java web app is the UrlRewriteFilter library.
 
Joe Areeda
Ranch Hand
Posts: 334
2
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf,

I'll see if I can get that to work. I may be back.

Joe
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!