This is my second shot at asking the question - I'll provide some more details this time to help get an informed answer.
What I'm trying to really do here is populate a drop-down menu with data that is dynamically generated from an executable that's supposed to run on a page load. The catch is, the executable must be in a directory local to the JSP on the server. My company has 3 or 4 clones of this website and I cannot place the executable in some absolute filepath - it must be relative (because it will be shipped with the JSP page to other processors all at once by some other team).
I know that JSP has the ability to run executables with relative paths because I could run this:
<form action="./my_executable_that_generates_a_dynamic_page">
However, I need this to run from a servlet to populate the dropbox using javascript.
<%= new File("./exec_produce_dropdown_list").getPath() %>
The above snippet gives me a different directory.
I've also tried:
<%= new File(new File(request.getServletContext().getRealPath(request.getRequestURI())).getParent().replace('\\', '/'), "exec_produce_dropdown_list"); %>
And this is pretty close except if there's a virtual path in the URI that doesn't correspond to the filesystem (which is what we have), it won't point to the right directory.
Is there a simple way for me to run the executable?? I also would like to add that there is no web.xml for me to work with.