0
  • Front-End Web Server: Windows Server 2008 R2 SP1

  • Back-end Web Server: Tomcat 5.5 -- JSP/Servlet Engine

  • Front-End and Back-End Web Servers are linked by an AJP Connector, which is an isapi filter running on IIS.

  • Tomcat and IIS are on the same server.

I have a number of folders with files that end in .HTML. The files are located in the same directory that Tomcat reads from, i.e. wwwroot/tomcat_webapp/HTMLProjectFiles. The AJP Connector -- or isapi filter -- will take care of passing anything to tomcat from the tomcat_webapp follder.

I need to have Tomcat process them, but I cannot rename the files to JSP. Tomcat's web.xml doesn't allow filtering via directory AND extension (i.e./ HTMLProjectFiles/*.html cannot be done and will generate an error). I don't want to permit JSP to process ALL HTML pages.

My idea was to use IIS' URL Rewrite engine. I created an inbound rule which rewrites the file with a JSP extension. Unfortunately, it's not working. I think the isapi filter may be firing before the URL Rewrite engine fires and, therefore, IIS never pushes the file over to Tomcat. At least, that's not my hunch. I'm not sure why else it's not working or if there is an order of precedence in IIS with URL Rewrite and isapi filter modules.

Anybody have any success or similar experience with this?

Update

My hunch is IIS scans the URL, sees that tomcat_webapp folder is present and doesn't bother looking at the page and just sends it off to Tomcat. Then, tomcat just displays the page as is. Currently, Tomcat's web.xml processes html as static pages. So, I may have to look into a url rewrite that works directly with tomcat. I dont' think mod_rewrite can work since I'm not running Apache.

Thank you very much.

user717236
  • 4,959
  • 19
  • 66
  • 102
  • `"I have a number of folders with files that end in .HTML."` *Where?* Seriously that's an important question. If the file actually exists in IIS already, you can't pass the request over to Tomcat. IIS will use its own files where they exist in IIS. – developerwjk Aug 06 '14 at 19:59
  • You have Tomcat and IIS on the same server reading from the same location? – developerwjk Aug 06 '14 at 20:20
  • Yes, Tomcat and IIS are on the same server. – user717236 Aug 06 '14 at 20:24
  • Personally I think you'd have a lot less problems if you keep the wwwroot of IIS separate from the wwwroot of Tomcat. Same server is Ok...same folder, not a good idea. – developerwjk Aug 06 '14 at 21:11
  • I definitely see your point. But it's not my call. Above my pay grade. – user717236 Aug 06 '14 at 21:21
  • Maybe so, but you should advise them of how its a security risk. You're one setting glitch away from IIS displaying the code of your JSPs to the user. – developerwjk Aug 06 '14 at 21:26
  • Please share a demo folder structure, could help in resolving the issue – Mohit Sethi Aug 24 '14 at 08:21

1 Answers1

0

It could help if you could provide demo folder structure of your deployment. To my current understanding, it could be resolved by:

  • Updating your uriworkermap.properties with an entry speifying the URL of the html resource directory and associating the worker with it. Example: portal.com/tomcat_webapp/html_folder_name/*=worker1
Mohit Sethi
  • 191
  • 9