http://www.eteks.com

com.eteks.awt.servlet
Class PJARedirectServlet

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

public class PJARedirectServlet
extends PJAServlet

This servlet uses PJAServlet services to get a default toolkit, and redirects all servlet calls to a destination servlet ensuring to it to have a default toolkit at disposal for graphics servlet. The destination servlet class can be coded in either ways :

For example, if you wanted to call a servlet with the URL http://server/servlet/com.eteks.servlet.DefaultToolkitTest?param1=value1¶m2=value2 you have to change by http://server/servlet/com.eteks.awt.servlet.PJARedirectServlet?destinationServletClass=com.eteks.servlet.DefaultToolkitTest¶m1=value1¶m2=value2 Or if you servlet initialization file contained something like :
servlet.toolkit.code=com.eteks.servlet.DefaultToolkitTest
 servlet.toolkit.initArgs=initParam1=value1, initParam2=value2
It will become :
servlet.toolkit.code=com.eteks.awt.servlet.PJARedirectServlet
 servlet.toolkit.initArgs=initParam1=value1, initParam2=value2, destinationServletClass=com.eteks.servlet.DefaultToolkitTest, toolkitFontsPath=pathWithPJAForTTFFonts

Since:
PJA2.1
Version:
2.1
Author:
Emmanuel Puybaret
See Also:
Serialized Form

Field Summary
static java.lang.String DESTINATION_SERVLET_CLASS_PARAMETER
           
static java.lang.String FONTS_PATH_PARAMETER
           
 
Constructor Summary
PJARedirectServlet()
           
 
Method Summary
 void destroyPJA()
          Override this method instead of the final method destroy ().
 void doDeletePJA(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Override this method instead of the final method doDelete ().
 void doGetPJA(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Override this method instead of the final method doGet ().
 void doOptionsPJA(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Override this method instead of the final method doOptions ().
 void doPostPJA(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Override this method instead of the final method doPost ().
 void doPutPJA(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Override this method instead of the final method doPut ().
 void doTracePJA(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Override this method instead of the final method doTrace ().
 javax.servlet.http.HttpServlet getDestinationServlet(java.lang.String destServletClass, java.lang.String fontsPath, boolean init)
           
 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.
 void initPJA(javax.servlet.ServletConfig config)
          Override this method instead of the final method init (ServletConfig config).
 javax.servlet.http.HttpServlet instantiateDestinationServlet(java.lang.String destServletClass, boolean init)
           
 void servicePJA(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Override this method instead of the final method service (HttpServletRequest req, HttpServletResponse resp).
 
Methods inherited from class com.eteks.awt.servlet.PJAServlet
createImage, destroy, doDelete, doGet, doOptions, doPost, doPut, doTrace, getServletInfo, getServletInfoPJA, getSystemProperty, getUserHomeDir, init, init, initPJA, isDefaultToolkitAvailable, service, service, 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
 

Field Detail

DESTINATION_SERVLET_CLASS_PARAMETER

public static final java.lang.String DESTINATION_SERVLET_CLASS_PARAMETER

FONTS_PATH_PARAMETER

public static final java.lang.String FONTS_PATH_PARAMETER
Constructor Detail

PJARedirectServlet

public PJARedirectServlet()
Method Detail

instantiateDestinationServlet

public javax.servlet.http.HttpServlet instantiateDestinationServlet(java.lang.String destServletClass,
                                                                    boolean init)
                                                             throws javax.servlet.ServletException

getDestinationServlet

public javax.servlet.http.HttpServlet getDestinationServlet(java.lang.String destServletClass,
                                                            java.lang.String fontsPath,
                                                            boolean init)
                                                     throws javax.servlet.ServletException

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")

initPJA

public void initPJA(javax.servlet.ServletConfig config)
             throws javax.servlet.ServletException
Description copied from class: PJAServlet
Override this method instead of the final method init (ServletConfig config). PJAServlet implementation calls super.init (config).
Overrides:
initPJA in class PJAServlet

destroyPJA

public void destroyPJA()
Description copied from class: PJAServlet
Override this method instead of the final method destroy (). PJAServlet implementation calls super.destroy ().
Overrides:
destroyPJA in class PJAServlet

doPostPJA

public void doPostPJA(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 doPost (). PJAServlet implementation calls super.doPost ().
Overrides:
doPostPJA in class PJAServlet

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

doPutPJA

public void doPutPJA(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 doPut (). PJAServlet implementation calls super.doPut ().
Overrides:
doPutPJA in class PJAServlet

doDeletePJA

public void doDeletePJA(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 doDelete (). PJAServlet implementation calls super.doDelete ().
Overrides:
doDeletePJA in class PJAServlet

doOptionsPJA

public void doOptionsPJA(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 doOptions (). PJAServlet implementation calls super.doOptions ().
Overrides:
doOptionsPJA in class PJAServlet

doTracePJA

public void doTracePJA(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 doTrace (). PJAServlet implementation calls super.doTrace ().
Overrides:
doTracePJA in class PJAServlet

servicePJA

public void servicePJA(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 service (HttpServletRequest req, HttpServletResponse resp). PJAServlet implementation calls super.service (req, resp).
Overrides:
servicePJA in class PJAServlet

© 1997-2001 eTeks - All rights reserved