pj
Class PJServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by pj.PJServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

Deprecated. Replaced by Servlet.

public class PJServlet
extends javax.servlet.http.HttpServlet

servlet to run pj from tomcat for the request web page generated by this servlet.

This servlet supports GET and POST with the same key/value pairs. The servlet creates a page with defaults to request the web service and replies to this page with output from PJ or with error messages from javac or with an applet, just like Servlet.

The applet uses GET to request and delete an archive with the result of the compilation and with System which will spoof standard i/o.

applet basename of a temporary jar file for an applet which will be deleted. Takes precedence over all other key/value pairs.
source input text for pj, takes precedence over url.
url address of input text for pj. One of source and url is mandatory. A partial URL is relative to referer. Only HTTP is supported.
target selects the reply:
check log of syntax checks.
dump dump of source as a tree.
factory Java code for tree factory.
java complete Java code.
jay input for jay.
scanner input for JLex.
run applet page to run program, from Javac.

If none, reply is request page.

animate generate parser animation if value starts with 0 through 3.
flatten squeeze out a single ArrayList parameter in parse tree if value starts with t.
jay check grammar with jay if value starts with t.
recover generate error recovery for iterations if value starts with t.
referer URL to resolve a partial url; taken from the header value sent by the browser (which does not exist for file:).
scanner generate scanner with JLex if value starts with t.
scannerOnly if target is run test scanner only if value starts with t. The scanner must be static and named yyLex.
scannerStatic generate scanner as a static inner class if value starts with t.
trace generate parser with trace if value starts with t.
tree generate parse tree factory if value starts with t.
treeStatic generate parse tree factory as a static inner class if value starts with t.
verbose generate parser description if value starts with t.
yellow emphasize a submission button in the request page if value contains the target.

See Also:
Serialized Form

Field Summary
protected  String appletJar
          Deprecated. jar from which applet jar is created.
protected  String appletPattern
          Deprecated. pattern to validate applet value.
protected  String appletPrefix
          Deprecated. prepended to applet value to create path to jar.
protected  String appletSource
          Deprecated. source file for applet.
protected  String bootclasspath
          Deprecated. options to crosscompile (e.g., for MSIE to 1.3).
protected  int expire
          Deprecated. expiration intervall for archive in milliseconds.
protected  String extdirs
          Deprecated. options to crosscompile (e.g., for MSIE to 1.3).
protected  String jar
          Deprecated. paths to javac, jar, and rm.
protected  String javac
          Deprecated. paths to javac, jar, and rm.
protected  String rm
          Deprecated. paths to javac, jar, and rm.
protected  String servletBasename
          Deprecated. servlet's name.
protected  String servletDirname
          Deprecated. servlet's context path.
protected  String sourceOption
          Deprecated. options to crosscompile (e.g., for MSIE to 1.3).
 
Constructor Summary
PJServlet()
          Deprecated.  
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Deprecated. process the request, regardless of submission method.
static void doJava(PJ.Parser parser, PrintWriter jayOut, PrintWriter err, String animate, boolean flatten, boolean recover, boolean scanner, boolean scannerStatic, boolean spoof, boolean trace, boolean tree, boolean treeStatic)
          Deprecated. preprocess using JLex and jay.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Deprecated.  
protected  int getInitParameter(String key, int dflt)
          Deprecated. return dflt or init-param.
protected  String getInitParameter(String key, String dflt)
          Deprecated. return dflt or init-param.
 void init()
          Deprecated. read web.xml.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

appletPattern

protected String appletPattern
Deprecated. 
pattern to validate applet value.


appletPrefix

protected String appletPrefix
Deprecated. 
prepended to applet value to create path to jar.


appletJar

protected String appletJar
Deprecated. 
jar from which applet jar is created.


appletSource

protected String appletSource
Deprecated. 
source file for applet.


servletDirname

protected String servletDirname
Deprecated. 
servlet's context path.


servletBasename

protected String servletBasename
Deprecated. 
servlet's name.


javac

protected String javac
Deprecated. 
paths to javac, jar, and rm.


jar

protected String jar
Deprecated. 
paths to javac, jar, and rm.


rm

protected String rm
Deprecated. 
paths to javac, jar, and rm.


expire

protected int expire
Deprecated. 
expiration intervall for archive in milliseconds.


sourceOption

protected String sourceOption
Deprecated. 
options to crosscompile (e.g., for MSIE to 1.3).


bootclasspath

protected String bootclasspath
Deprecated. 
options to crosscompile (e.g., for MSIE to 1.3).


extdirs

protected String extdirs
Deprecated. 
options to crosscompile (e.g., for MSIE to 1.3).

Constructor Detail

PJServlet

public PJServlet()
Deprecated. 
Method Detail

init

public void init()
Deprecated. 
read web.xml.

Overrides:
init in class javax.servlet.GenericServlet

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws IOException,
                   javax.servlet.ServletException
Deprecated. 
Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
IOException
javax.servlet.ServletException

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws IOException,
                  javax.servlet.ServletException
Deprecated. 
process the request, regardless of submission method. Replies with report or request or applet page.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
IOException
javax.servlet.ServletException

doJava

public static void doJava(PJ.Parser parser,
                          PrintWriter jayOut,
                          PrintWriter err,
                          String animate,
                          boolean flatten,
                          boolean recover,
                          boolean scanner,
                          boolean scannerStatic,
                          boolean spoof,
                          boolean trace,
                          boolean tree,
                          boolean treeStatic)
                   throws IOException,
                          Log
Deprecated. 
preprocess using JLex and jay. Packaged as a function so that it can be shared by java and run.

Parameters:
spoof - if true, spoof System.
Throws:
Log - to describe what went wrong.
IOException

getInitParameter

protected int getInitParameter(String key,
                               int dflt)
Deprecated. 
return dflt or init-param.


getInitParameter

protected String getInitParameter(String key,
                                  String dflt)
Deprecated. 
return dflt or init-param.