Re: newbie with a short question
Couple of things 1. You will get better responses on this list if you review the posting guide at. This post is way to vague to get specific answers. So most people are not going to respond to it. http://jakarta.apache.org/site/mail.html 2. If I follow the description correctly you are uploading a batch file to tomcat. Then loading a page with a link to that batch file. Then you are clicking on the link and it is displaying contents of the batch file. If I followed all of the correctly that is exactly what should happen. If you are clicking on an Http link that posts to a web server that server is going to try to return the requested resource. If you need to execute a file locally from Tomcat then you need to use one of the Java method calls to execute native files. This by the way is usually a bad idea. Is what ever your batch file is doing really a process that you can not recreate in java? If I have misunderstood entirely which seems likely then you may want to repost the question formated in accordance with the posting guilds lines listed above. Posts to support forums should always include a detailed step by step lise of the process that creates the failing, copies of relevant configuration files(Saying you deleted some comments in a config file does not really help. We need to see it.), and the lines of code that are believed to be failing. nick sturm wrote: ok, I have done the two things on that page: renamed the serverlet and deleted the comments around the cgi section of the web.xml config file. I created a directory (cgi-bin) under root and under WEB-INF neither of which would execute the batch file when I link to them. it would just open the batch file. thanks, sorry I'm very new to this. -n On 8/24/05, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Allistair Crossley [mailto:[EMAIL PROTECTED] Subject: RE: newbie with a short question First I cause an open/save prompt with response.addHeader(Content-Disposition, attachment; filename=somebat.bat); Then I use the response.getOutputStream() and stream the bat file down it. This requires of course that you get an inputstream to your bat file first. Copy it into your webapp somewhere and use the servlet context getRealPath(/bat/mybat.bat) and then i/o API to read it into an input stream before sending outbound again. I found that setting content type of application/msdos-x-batch failed, as did others, just send it without a content type as a open/save. I must be missing something; how does the above cause an existing .bat file on the server to be executed on the server? (That was the original question.) For the OP: the CGI doc for Tomcat can be found at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/cgi-howto.html - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie with a short question
The JVM by default does not allow you to run anything on the client. You will have to change the .properties file on the client to enable the server to interact with the client's file system etc. This is one of the reasons JavaScript is safer than VBScript. The VBVM allows the browser to do anything the logged in user can do. This is one of the reasons that VBScript is used for installing a lot if the viruses and worms. What is it that you need to do from the servlet? It looks like what you want to do is something that could be dangerous if allowed by the user. Most network administrators would go nuts with this. You may want to find some other way to accomplish what you are trying to do. Robert S. Harper Information Access Technology, Inc. -Original Message- From: Brian Cook [mailto:[EMAIL PROTECTED] Sent: Friday, August 26, 2005 10:28 AM To: Tomcat Users List Subject: Re: newbie with a short question Couple of things 1. You will get better responses on this list if you review the posting guide at. This post is way to vague to get specific answers. So most people are not going to respond to it. http://jakarta.apache.org/site/mail.html 2. If I follow the description correctly you are uploading a batch file to tomcat. Then loading a page with a link to that batch file. Then you are clicking on the link and it is displaying contents of the batch file. If I followed all of the correctly that is exactly what should happen. If you are clicking on an Http link that posts to a web server that server is going to try to return the requested resource. If you need to execute a file locally from Tomcat then you need to use one of the Java method calls to execute native files. This by the way is usually a bad idea. Is what ever your batch file is doing really a process that you can not recreate in java? If I have misunderstood entirely which seems likely then you may want to repost the question formated in accordance with the posting guilds lines listed above. Posts to support forums should always include a detailed step by step lise of the process that creates the failing, copies of relevant configuration files(Saying you deleted some comments in a config file does not really help. We need to see it.), and the lines of code that are believed to be failing. nick sturm wrote: ok, I have done the two things on that page: renamed the serverlet and deleted the comments around the cgi section of the web.xml config file. I created a directory (cgi-bin) under root and under WEB-INF neither of which would execute the batch file when I link to them. it would just open the batch file. thanks, sorry I'm very new to this. -n On 8/24/05, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Allistair Crossley [mailto:[EMAIL PROTECTED] Subject: RE: newbie with a short question First I cause an open/save prompt with response.addHeader(Content-Disposition, attachment; filename=somebat.bat); Then I use the response.getOutputStream() and stream the bat file down it. This requires of course that you get an inputstream to your bat file first. Copy it into your webapp somewhere and use the servlet context getRealPath(/bat/mybat.bat) and then i/o API to read it into an input stream before sending outbound again. I found that setting content type of application/msdos-x-batch failed, as did others, just send it without a content type as a open/save. I must be missing something; how does the above cause an existing .bat file on the server to be executed on the server? (That was the original question.) For the OP: the CGI doc for Tomcat can be found at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/cgi-howto.html - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie with a short question
nick sturm wrote: ok, I have done the two things on that page: renamed the serverlet and deleted the comments around the cgi section of the web.xml config file. Uh, you probably want to *read* those comments :-) -- specifically !-- executableName of the exectuable used to run the -- !-- script. [perl] Perl being the default, you'll have to figure out how to use the COMMAND.COM or whatever it is for Windows. Alternatively, write a Perl wrapper for it or just rewrite your .BAT file in Perl. *Or* byte, er, bite the bullet, google `java serial port controller` and just write what you need in Java :-) Good luck, -- Hassan Schroeder - [EMAIL PROTECTED] Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com dream. code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie with a short question
ok, I have done the two things on that page: renamed the serverlet and deleted the comments around the cgi section of the web.xml config file. I created a directory (cgi-bin) under root and under WEB-INF neither of which would execute the batch file when I link to them. it would just open the batch file. thanks, sorry I'm very new to this. -n On 8/24/05, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Allistair Crossley [mailto:[EMAIL PROTECTED] Subject: RE: newbie with a short question First I cause an open/save prompt with response.addHeader(Content-Disposition, attachment; filename=somebat.bat); Then I use the response.getOutputStream() and stream the bat file down it. This requires of course that you get an inputstream to your bat file first. Copy it into your webapp somewhere and use the servlet context getRealPath(/bat/mybat.bat) and then i/o API to read it into an input stream before sending outbound again. I found that setting content type of application/msdos-x-batch failed, as did others, just send it without a content type as a open/save. I must be missing something; how does the above cause an existing .bat file on the server to be executed on the server? (That was the original question.) For the OP: the CGI doc for Tomcat can be found at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/cgi-howto.html - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie with a short question
Hi, I did this the other day with a bat file. First I cause an open/save prompt with response.addHeader(Content-Disposition, attachment; filename=somebat.bat); Then I use the response.getOutputStream() and stream the bat file down it. This requires of course that you get an inputstream to your bat file first. Copy it into your webapp somewhere and use the servlet context getRealPath(/bat/mybat.bat) and then i/o API to read it into an input stream before sending outbound again. I found that setting content type of application/msdos-x-batch failed, as did others, just send it without a content type as a open/save. You'd do this in a servlet. Allistair -Original Message- From: nick sturm [mailto:[EMAIL PROTECTED] Sent: 24 August 2005 17:21 To: Tomcat Users List Subject: newbie with a short question I am new to any web server, but hopefully this question is easilly answered: If I wanted to make a link to execute a .bat file locally on the server when a link is pressed, how would I do so? I am making a pan/tiltable webcam and hope to use the siple controls shown here: http://www.geocities.com/zoomkat/byte.htm my major confusion stems from there not being a cgi directory. (upon first inspection) Sorry for my ignorance, -n - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie with a short question
From: Allistair Crossley [mailto:[EMAIL PROTECTED] Subject: RE: newbie with a short question First I cause an open/save prompt with response.addHeader(Content-Disposition, attachment; filename=somebat.bat); Then I use the response.getOutputStream() and stream the bat file down it. This requires of course that you get an inputstream to your bat file first. Copy it into your webapp somewhere and use the servlet context getRealPath(/bat/mybat.bat) and then i/o API to read it into an input stream before sending outbound again. I found that setting content type of application/msdos-x-batch failed, as did others, just send it without a content type as a open/save. I must be missing something; how does the above cause an existing .bat file on the server to be executed on the server? (That was the original question.) For the OP: the CGI doc for Tomcat can be found at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/cgi-howto.html - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]