I am working on a research project in which I would like to use servlet technology for something other than http servlets. In a nutshell I am trying to extend G code ( the language of CNC routers ) using servlet technology. What I want to do is create something similar to JSP called GSP (GcodeServerPages).
A GSP would contain a program to run a CNC machine. The "fixed template text" would be G code instructions (instead of HTML) and the the page would be able to dynamically generate content that is written in Java. In order to do this I would like to have Tomcat (or other Container) be able to communicate with an application that I am calling an 'Interactive Environment' (later referrred to as IE, not to be confused with Internet Explorer) as well as a CNC router machine. Tomcat and the IE would be running on one computer and the CNC router would be connected to this computer via a serial cable (RS232). I found this article regarding COM ports that was encouraging: http://www.jguru.com/faq/view.jsp?EID=1048895 The IE would have at least a text editor and a way to 'browse' the local filesystem. From within the IE a programmer could write GSP's and be able to instruct the Container to evaluate and execute the GSP. The Container would be able to then send its instructions to the CNC. Here we come to one of the interesting sticky bits. During execution of a CNC program (written in traditional G code) it is possible to allow interactivity with the machinist. For example a program to cut triangles out of a piece of aluminum might ask the operator "How many triangles would you like?", "What is the length of the base?" etc... and then once this data has been collected the program could determine how to cut out the triangles. With this in mind, for my project I would like the CNC to be able to talk back to the Container over the serial connector. So there are two kinds of communication that the Container needs to be able to perform: 1. Communication between the IE and the container and 2. Communication between the CNC router and the container. What I would like to know is does any of this sound feasible using Tomcat as my Container? If not, I would certainly be willing to write my own simpler Container to do the job but obviously it would be better to use the existing software if it can be configured to suit my needs. What I worry about is that Tomcat may be so intertwined with handling HTTP that it will not be flexible enough to do something completely different. Thanks, Sean Nagle