I am putting together the next round of updates to the CGIGatewayServlet 
which provides CGI capabilities (especially if you map it to /cgi-bin/* :)).

Hopefully this will take it to full beta-level; I would like to get it 
to a point where it can be included in CVS & the next beta of Tomcat 4.0.

A couple of issues have arisen and I would like to solicit opinions on:

1) Name, Package, and Inner Classes
2) Providing Functional testing classes
3) Providing Examples
4) Addition to default context
5) Default location of cgi scripts

This is my first attempt at wide feedback/partipation, so please let me 
know any meta-comments, definitely. (For example, is this off-topic, too 
much detail, etc.?)


Issues:

1) Name, Package, and Inner Classes:

Name:  Current name is CGIGatewayServlet.  The rationale is "this is the 
first name I thought of."  Would we prefer CGIInvokerServlet?

Package: Right now I have put this code in one source file in the 
org.apache.catalina.servlets package.  I believe this to be the right 
package based on WebDav, SsiInvoker, and other similar servlets.  Any 
suggestions?

Inner Classes:  The CGIGatewayServlet.java file has one main class and 
two inner classes.  Do we have any design-type preferences or lack 
thereof vis-a-vis inner classes?  The inner classes could be moved out 
to org.apache.catalina.util as a thought.  My personal inclination would 
be to leave them as inner classes, since they are not particularly 
applicable to other parts of catalina.  However, that could be viewed as 
slightly detracting from their maintainability...


2) Addition to default context

Would this CGI servlet be added to the default context similar to 
SsiInvokerServlet?  If so, would people prefer I do that myself and 
submit a load of file patches for the commit of the CGI servlet & 
related files which included the catalina web.xml?



3) Providing Examples

Would it be appropriate to provide some links in the examples webapp 
along with an example cgi script?  I would have thought so...


3) Providing Functional testing classes

I was wondering if and how I should add any testing cgi scripts.  I have 
some (obviously :)), but should they be put into the tester area because 
they are for testing, or should I reuse some examples webapp (above 
issue #2) cgi scripts?  Any issues with this dependency?


5) Default location of cgi scripts

In another project, we have put all cgi scripts under 
<webapp>/WEB-INF/cgi since they are then 1) not liable to be served by 
the container; yet 2) still encapsulated underneath the webapp's own 
directory structure.

One observation and two issues here:

Observation: the Servlet spec is obviously silent on CGI placement 
issues; yet we should probably support (and even default to?) something 
congruent with standard CGI practice of separating the HTML and CGI 
scripts (/doc-root and /cgi-bin) while not encouraging anything which 
breaks the Servlet API's web application filesystem (or war file) 
boundaries.

Issue 1) generally, how do people like the <webapp>/WEB-INF/cgi solution 
in light of the above observation?

Issue 2) if people like it, should we make it the default setting (by 
defining an init-parameter for the CGI servlet in the container-wide 
web.xml file)?


Thanks in advance for feedback/suggestions.

Chrs,
Martin

Reply via email to