Apache returns uncomplied JSP when error happens

harlanhugh used Ask the Experts™
I have a call to a JSP that looks something like this: http://www.somecompany.com/main/jsp/reports/selectDBStuff.jsp

However if the user were to do take the following line and add '%20 to the end, making it look like this: I have a call to a JSP that looks something like this: http://www.somecompany.com/main/jsp/reports/selectDBStuff.jsp%20

 it would then return and show the uncompiled JSP. I need to know how to stop this.

I have tried this on both Apache and Tomcat and also going directly to Tomcat... It appears to only happen when using both apache and Tomcat, so I am assuming this is an Apache issue? Again any help on how to stop this would be appreciated.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
It could be a problem with the additional space(%20 as per URL encoding)  that you are trying to append to the URL. I am assuming that you are using some kind of a connector to send the call from Apache to Tomcat.

In this case what could be happening is that Apache would try to resolve the URL by checking if it has a file in that location; if it does it will send the un-compiled file to the browser.

There are 2 ways to try to fix this.

1. Remove any JSP files that are lying in the Apache web server directory.
2. Add a rule in Apache to trim the URL before processing it.

In case you are looking at specific inputs, you would need to provide us with the re-direction information so that we can help you further.


Is there a rule in Apache where I could tell it not to send the uncompiled JSP?
No, it will send the file it it finds it at the location specified.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial