http://www.eteks.com

com.eteks.servlet
Class PJAServletTest

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--com.eteks.awt.servlet.PJAServlet
                    |
                    +--com.eteks.servlet.PJAServletTest
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class PJAServletTest
extends PJAServlet

This servlet/program tests if graphics can work on a JVM or not, with PJAServlet as super class. Servlet can be tested with the URL http://..../servlet/com.eteks.servlet.PJAServletTest Program can be tested with the command java -classpath pja.jar com.eteks.servlet.PJAServletTest (or java -Xbootclasspath/a:pja.jar com.eteks.servlet.PJAServletTest) You may have to override or modify the method getFontsPath () to add the directory where fonts are stored.

Since:
PJA2.1
Version:
2.1
Author:
Emmanuel Puybaret
See Also:
PJAToolkit, PJAServlet, PJARedirectServlet, Serialized Form

Constructor Summary
PJAServletTest()
           
 
Method Summary
 void doGetPJA(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Override this method instead of the final method doGet ().
 java.lang.String getFontsPath()
          Override this method to return the fonts path where .pjaf files (JDK 1.1) or True Type files (JDK >= 1.2) can be found.
 java.lang.String getUserHomeDir()
          Override this method to return the user home directory where the file lib/font.properties can be found.
static void main(java.lang.String[] args)
           
 void test(java.io.PrintStream out)
          Tries to instantiate default toolkit and Font class and writes on out stream if it succeeded or failed.
 
Methods inherited from class com.eteks.awt.servlet.PJAServlet
createImage, destroy, destroyPJA, doDelete, doDeletePJA, doGet, doOptions, doOptionsPJA, doPost, doPostPJA, doPut, doPutPJA, doTrace, doTracePJA, getServletInfo, getServletInfoPJA, getSystemProperty, init, init, initPJA, initPJA, isDefaultToolkitAvailable, service, service, servicePJA, servicePJA, testDefaultToolkit
 
Methods inherited from class javax.servlet.http.HttpServlet
getLastModified
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PJAServletTest

public PJAServletTest()
Method Detail

doGetPJA

public void doGetPJA(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Description copied from class: PJAServlet
Override this method instead of the final method doGet (). PJAServlet implementation calls super.doGet ().
Overrides:
doGetPJA in class PJAServlet

test

public void test(java.io.PrintStream out)
Tries to instantiate default toolkit and Font class and writes on out stream if it succeeded or failed. This ensures that AWT toolkit is enabled.

getFontsPath

public java.lang.String getFontsPath()
Description copied from class: PJAServlet
Override this method to return the fonts path where .pjaf files (JDK 1.1) or True Type files (JDK >= 1.2) can be found. If you want to return more than one directory separate them with File.pathSeparator.
Note : This method is called from within PJAServlet constructor.
Overrides:
getFontsPath in class PJAServlet
Following copied from class: com.eteks.awt.servlet.PJAServlet
Returns:
PJAServlet implementation returns "." + File.pathSeparator + getSystemProperty ("user.dir") + File.pathSeparator + getSystemProperty ("java.home")

getUserHomeDir

public java.lang.String getUserHomeDir()
Description copied from class: PJAServlet
Override this method to return the user home directory where the file lib/font.properties can be found. This is usefull for JDK 1.2.
Note : This method is called from within PJAServlet constructor.
Overrides:
getUserHomeDir in class PJAServlet
Following copied from class: com.eteks.awt.servlet.PJAServlet
Returns:
PJAServlet implementation returns getSystemProperty ("user.home")

main

public static void main(java.lang.String[] args)

© 1997-2001 eTeks - All rights reserved