RE: RequestDispatcher.forward to cgi?
Tim, Now that I look at them closely I see that most of them are due to a looping problem in my program. So it just logs over and over that it's forwarding the request. I'll investigate to see if the loop is due to an error in my progamming (certainly possible since I've had to tinker with a very large controller servlet in order to incorporate this cgi page) or due to a failure in forwarding. What I was hoping in asking the question though was to find out whether anyone had done this successfully or not. I'm happy to troubleshoot the problem if I think there's a chance of success. But I hate to spend the time on it if I'm just trying to do the impossible or the dumb. Ken -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Thursday, December 04, 2003 9:21 PM To: Tomcat Users List Subject: Re: RequestDispatcher.forward to cgi? Just curious ... what are the errors? -Tim Januski, Ken wrote: I've finally managed to get cgi working in Tomcat. Now I need to forward from a servlet to a cgi page. But both RequestDispatcher.forward and RequestDispatcher.include are failing. I'm not surprised that include does but I thought it might be possible with forward. Since this is part of a large application that keeps track of the session I'd like to be able to include the cgi page in the application. But I'm beginning to think that's not possible. So I wonder if anyone knows whether it's possible to forward to a cgi page within the same Tomcat webapp. If not I'll save myself a lot of trouble and just make it a separate webapp with just a cgi component. Thanks for any advice. Ken P.S. I'm using cgi with perl because I can't find a class to add IPTC information to a Jpg and I don't have time to write it myself. Such a module does already exist in Perl. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RequestDispatcher.forward to cgi?
I would think that the CGI servlet would work on a forward but you must be sure that: 1) No input streams were open (or that they are compatible with the CGIServlet) 2) On a POST, you do not call or look at request parameters or the input stream since it looks like the CGIServlet wants to pass the Inputstream right to the servlet. 3) I am unsure of how the CGI servlet goes to look for the exe with respect to a forward. (But I think you should be ok) -Tim Januski, Ken wrote: Tim, Now that I look at them closely I see that most of them are due to a looping problem in my program. So it just logs over and over that it's forwarding the request. I'll investigate to see if the loop is due to an error in my progamming (certainly possible since I've had to tinker with a very large controller servlet in order to incorporate this cgi page) or due to a failure in forwarding. What I was hoping in asking the question though was to find out whether anyone had done this successfully or not. I'm happy to troubleshoot the problem if I think there's a chance of success. But I hate to spend the time on it if I'm just trying to do the impossible or the dumb. Ken -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Thursday, December 04, 2003 9:21 PM To: Tomcat Users List Subject: Re: RequestDispatcher.forward to cgi? Just curious ... what are the errors? -Tim Januski, Ken wrote: I've finally managed to get cgi working in Tomcat. Now I need to forward from a servlet to a cgi page. But both RequestDispatcher.forward and RequestDispatcher.include are failing. I'm not surprised that include does but I thought it might be possible with forward. Since this is part of a large application that keeps track of the session I'd like to be able to include the cgi page in the application. But I'm beginning to think that's not possible. So I wonder if anyone knows whether it's possible to forward to a cgi page within the same Tomcat webapp. If not I'll save myself a lot of trouble and just make it a separate webapp with just a cgi component. Thanks for any advice. Ken P.S. I'm using cgi with perl because I can't find a class to add IPTC information to a Jpg and I don't have time to write it myself. Such a module does already exist in Perl. - 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: RequestDispatcher.forward to cgi?
Thanks Tim, I'll keep working on it then and see where it gets me. Ken -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Friday, December 05, 2003 12:54 PM To: Tomcat Users List Subject: Re: RequestDispatcher.forward to cgi? I would think that the CGI servlet would work on a forward but you must be sure that: 1) No input streams were open (or that they are compatible with the CGIServlet) 2) On a POST, you do not call or look at request parameters or the input stream since it looks like the CGIServlet wants to pass the Inputstream right to the servlet. 3) I am unsure of how the CGI servlet goes to look for the exe with respect to a forward. (But I think you should be ok) -Tim Januski, Ken wrote: Tim, Now that I look at them closely I see that most of them are due to a looping problem in my program. So it just logs over and over that it's forwarding the request. I'll investigate to see if the loop is due to an error in my progamming (certainly possible since I've had to tinker with a very large controller servlet in order to incorporate this cgi page) or due to a failure in forwarding. What I was hoping in asking the question though was to find out whether anyone had done this successfully or not. I'm happy to troubleshoot the problem if I think there's a chance of success. But I hate to spend the time on it if I'm just trying to do the impossible or the dumb. Ken -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Thursday, December 04, 2003 9:21 PM To: Tomcat Users List Subject: Re: RequestDispatcher.forward to cgi? Just curious ... what are the errors? -Tim Januski, Ken wrote: I've finally managed to get cgi working in Tomcat. Now I need to forward from a servlet to a cgi page. But both RequestDispatcher.forward and RequestDispatcher.include are failing. I'm not surprised that include does but I thought it might be possible with forward. Since this is part of a large application that keeps track of the session I'd like to be able to include the cgi page in the application. But I'm beginning to think that's not possible. So I wonder if anyone knows whether it's possible to forward to a cgi page within the same Tomcat webapp. If not I'll save myself a lot of trouble and just make it a separate webapp with just a cgi component. Thanks for any advice. Ken P.S. I'm using cgi with perl because I can't find a class to add IPTC information to a Jpg and I don't have time to write it myself. Such a module does already exist in Perl. - 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]
RequestDispatcher.forward to cgi?
I've finally managed to get cgi working in Tomcat. Now I need to forward from a servlet to a cgi page. But both RequestDispatcher.forward and RequestDispatcher.include are failing. I'm not surprised that include does but I thought it might be possible with forward. Since this is part of a large application that keeps track of the session I'd like to be able to include the cgi page in the application. But I'm beginning to think that's not possible. So I wonder if anyone knows whether it's possible to forward to a cgi page within the same Tomcat webapp. If not I'll save myself a lot of trouble and just make it a separate webapp with just a cgi component. Thanks for any advice. Ken P.S. I'm using cgi with perl because I can't find a class to add IPTC information to a Jpg and I don't have time to write it myself. Such a module does already exist in Perl.
Re: RequestDispatcher.forward to cgi?
Just curious ... what are the errors? -Tim Januski, Ken wrote: I've finally managed to get cgi working in Tomcat. Now I need to forward from a servlet to a cgi page. But both RequestDispatcher.forward and RequestDispatcher.include are failing. I'm not surprised that include does but I thought it might be possible with forward. Since this is part of a large application that keeps track of the session I'd like to be able to include the cgi page in the application. But I'm beginning to think that's not possible. So I wonder if anyone knows whether it's possible to forward to a cgi page within the same Tomcat webapp. If not I'll save myself a lot of trouble and just make it a separate webapp with just a cgi component. Thanks for any advice. Ken P.S. I'm using cgi with perl because I can't find a class to add IPTC information to a Jpg and I don't have time to write it myself. Such a module does already exist in Perl. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RequestDispatcher.forward to CGI
Hello, I've been trying to use the following procedure to forward a request from my servlet to a CGI program within the same application space getServletContext().getRequestDispatcher(/cgi-bin/my_cgi_prog).forward(request,response); ... which results in the following error Servlet invoker is currently unavailable Looking at Sun's servlet tutorial, they indicate that this would be possible. http://java.sun.com/docs/books/tutorial/servlets/communication/request-dispatcher.html However, I did notice that Tomcat's documentation makes no mention of being able to forward requests in this manner to CGI... only other JSPs and servlets. All I want is to pass the HTTP request to my CGI program via a servlet, the CGI program will respond with HTML and pass it back to the client browser via the servlet. So I have a few questions... 1) Has anybody been successful doing this? How? 2) If it's not possible in the current Tomcat, is it something that might be available soon (I noticed that this release is Tomcat's first shot at CGI availability)? 2) If it is not possible to do this in Tomcat, can anybody think of another solution? Response.sendRedirect is NOT an option. The reason I'm attempting this is because I want to control access and input to my CGI program through a servlet. I don't want the browser calling it directly. I'm thinking maybe the URLConnection class might be of use, but then I still have the issue of controlling access to it and maybe another performance hit. Or maybe I'm wrong. Ideas? Environment: Tomcat 4.0.4 (standalone) JDK 1.4 Redhat Linux 7.3 Thanks! _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]