TimeTraveler
IS-IT--Management
Here's my JSP page:
Here's my script:
Just for kicks, here's a servlet I D/L from the 'net:
What do I do to get the JSP to activate ? (to activate ?...) to activate the UNIX script?
I realize the middle one produced no stdout, but whatever, that's not the point really. The real script will run quiet - no stdout nor stderr, and no user input other than triggering it from the JSP page.
I previously posted this in another forum, and was told to post here.
The directory this resides in is not "seen" by any server except Weblogic. Really, I don't care if the JSP triggers a script (ala CGI) or a servlet (Weblogic/Tomcat/whatever).
Sean (Time Traveler)
Code:
<HTML>
<HEAD>
<% String title = "Foo Test"; %>
<% String foo = "Process p = new getRuntime().exec('./foo_test.cgi');"; %>
<% String bar = "./foo_test.cgi"; %>
<% String bat = "./foo_test.servlet"; %>
<TITLE><%= title %></TITLE>
</HEAD>
<BODY>
<H2><%= title %></H2>
<P>This page is Sean testing how to trigger a UNIX script from a .jsp page.</P>
<P>Going to try using CGI to launch a simple script.</P>
<P><A HREF="<%= foo %>" target="foo_out"><%= foo %></A> Now working</P>
<P><A HREF="<%= bar %>" target="foo_out"><%= bar %></A>This doesn't work either</P>
<P><A HREF="<%= bat %>"><%= bat %></A> Ditto</P>
</BODY>
</HTML>
Here's my script:
Code:
#!/bin/sh
touch $0.foo
Just for kicks, here's a servlet I D/L from the 'net:
Code:
import java.io.*;
// Import servlet packages (requires JDK1.2 or servlet toolkit)
import javax.servlet.*;
import javax.servlet.http.*;
public class MyFirstServlet extends HttpServlet
{
// We override the doGet method, from HttpServlet, to
// provide a custom GET method handler
public void doGet (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
res.setContentType("text/plain");
ServletOutputStream out = res.getOutputStream();
out.println ("Hello World!");
out.flush();
}
public String getServletInfo() {
return "MyFirstServlet";
}
}
What do I do to get the JSP to activate ? (to activate ?...) to activate the UNIX script?
I realize the middle one produced no stdout, but whatever, that's not the point really. The real script will run quiet - no stdout nor stderr, and no user input other than triggering it from the JSP page.
I previously posted this in another forum, and was told to post here.
The directory this resides in is not "seen" by any server except Weblogic. Really, I don't care if the JSP triggers a script (ala CGI) or a servlet (Weblogic/Tomcat/whatever).
Sean (Time Traveler)