TimeTraveler
IS-IT--Management
I have a non-interactive, quiet (no stdout/stderr) server-side program I need to run off a link on a .jsp page. My .jsp code is below.
I've tried specifying the .sh file as both .sh and .cgi, but either way it just exposes code in the browser window, showing bits of HTML where it shows up in vars and here-docs. So, it's obvious Tomcat or Weblogic or whatever doesn't provide for CGI. I normally do only CGI programming, and near-zero object-oriented coding. I've seen pages describing how to use Runtime.exec(), but only in a .java file, which I know nothing about and the number of lines of code for something like GoodExec or whatever is beyond me.
If this were a CGI project, I'd be done in a couple minutes, but this .jsp/.java stuff takes soooooo long to do, and there's always a gotcha.
Thanks in advance for any help.
Sean aka Time Traveler
Code:
<HTML>
<HEAD>
<% String title = "Foo Test"; %>
<% String foo = "./foo.sh"; %>
<TITLE><%= title %></TITLE>
<!-- filename: foo.jsp -->
</HEAD>
<BODY>
<H2><%= title %></H2>
<P>This page is testing how to trigger a UNIX script from a .jsp page.</P>
<P><A HREF="<%= foo %>" target="bar"><%= foo %></A></P>
</BODY>
</HTML>
I've tried specifying the .sh file as both .sh and .cgi, but either way it just exposes code in the browser window, showing bits of HTML where it shows up in vars and here-docs. So, it's obvious Tomcat or Weblogic or whatever doesn't provide for CGI. I normally do only CGI programming, and near-zero object-oriented coding. I've seen pages describing how to use Runtime.exec(), but only in a .java file, which I know nothing about and the number of lines of code for something like GoodExec or whatever is beyond me.
If this were a CGI project, I'd be done in a couple minutes, but this .jsp/.java stuff takes soooooo long to do, and there's always a gotcha.
Thanks in advance for any help.
Sean aka Time Traveler