TimeTraveler
IS-IT--Management
Alright folks,
As usual, searching posts in a the form and FAQs has yielded zipola, so I'm again asking what some may consider to be annoyingly easy and or bizzare.
Here's my stack:
[ul]
[li]Windows XP Home[/li]
[li]Batch file(s)[/li]
[li]Tomcat 5.5[/li]
[/ul]
Here are my constraints:
[ul]
[li]Limited Java/JSP/Servlet experience[/li]
[li]Windows XP Home[/li]
[li]CGI must use Windows XP Home 'cmd.exe' vs. 'perl' (for now)[/li]
[li]Not loading Apache or anything else[/li]
[/ul]
I'm prototyping a concept for work, that'll eventually be moved over into a Linux Weblogic environment.
Please do not reespond with "why are you doing that?!" or "just do ..." or anything response that doesn't include SPECIFIC code examples and file locations. Though I thank you for your time, posts like that are time wasters.
What I've done so far:
[ol]
[li] Installed Tomcat 5.5 and Admin package and it works[/li]
[li] Developed a callable DOS batch file
[/li]
[li] Created webapps\foo\index.jsp
[/li]
[li] Uncommented cgi and cgi mapping entries in conf\web.xml
[/li]
[li] In conf\web.xml I added the entry for executable to use 'cmd /q /c'
[/li]
[li] Renamed server\lib\servlets-cgi.renametojar to server\lib\servlets-cgi.jar
[/li]
[/ol]
And I'm getting a variety of errors from 404 to requested service not available and all of it.
Here are my files. Filename and locations noted inside the code.
Thanks in advance for any SPECIFIC help.
-Sean aka TimeTraveler
As usual, searching posts in a the form and FAQs has yielded zipola, so I'm again asking what some may consider to be annoyingly easy and or bizzare.
Here's my stack:
[ul]
[li]Windows XP Home[/li]
[li]Batch file(s)[/li]
[li]Tomcat 5.5[/li]
[/ul]
Here are my constraints:
[ul]
[li]Limited Java/JSP/Servlet experience[/li]
[li]Windows XP Home[/li]
[li]CGI must use Windows XP Home 'cmd.exe' vs. 'perl' (for now)[/li]
[li]Not loading Apache or anything else[/li]
[/ul]
I'm prototyping a concept for work, that'll eventually be moved over into a Linux Weblogic environment.
Please do not reespond with "why are you doing that?!" or "just do ..." or anything response that doesn't include SPECIFIC code examples and file locations. Though I thank you for your time, posts like that are time wasters.
What I've done so far:
[ol]
[li] Installed Tomcat 5.5 and Admin package and it works[/li]
[li] Developed a callable DOS batch file
[/li]
[li] Created webapps\foo\index.jsp
[/li]
[li] Uncommented cgi and cgi mapping entries in conf\web.xml
[/li]
[li] In conf\web.xml I added the entry for executable to use 'cmd /q /c'
[/li]
[li] Renamed server\lib\servlets-cgi.renametojar to server\lib\servlets-cgi.jar
[/li]
[/ol]
And I'm getting a variety of errors from 404 to requested service not available and all of it.
Here are my files. Filename and locations noted inside the code.
Code:
:: filename: webapps\ROOT\cgi-bin\time.bat
:: purpose: generate some trivial output to test Tomcat
CGI
echo Content-type: text/html
echo.
echo.
echo ^<html^>
echo ^<body^>
echo ^<P^>Time is
time /t
echo ^<^/P^>
echo ^<^/body^>
echo ^<^/html^>
Code:
<!-- filename: webapps\foo\index.jsp -->
<!-- purpose: trigger a DOS batch file via CGI in Tomcat -->
<html>
<head>
<% String title = "foo page"; %>
<% String doThis = "/cgi-bin/time.bat"; %>
<title><%= title %></title>
</head>
<body>
<h2><%= title %></h2>
<P>Click button to see time.</P>
<form method="POST" action="<%= doThis %>">
<input type="submit" value="<%= doThis %>"></input>
</form>
</body>
</html>
Thanks in advance for any SPECIFIC help.
-Sean aka TimeTraveler