|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
JSPservletPkg.JSPservlet
Class invoked by servlet container for a given context path. It forwards the requests to a compiled jsp or servlet loaded by JSPloader.
Copyright (c) 2000-2001
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
JSPhandler,
JSPhandler.ClassEntry,
JSPloader| Inner Class Summary | |
(package private) class |
JSPservlet.IncludeWriter
Helper class. |
| Field Summary | |
(package private) static int[] |
aReason
Array of used HTTP codes. |
static java.util.Map |
JSPhandlers
Synchronized HashMap key: contextPath value: JSPhandler |
private static java.text.SimpleDateFormat |
sdf
SimpleDateFormat used to build RFC conformant strings |
| Constructor Summary | |
JSPservlet()
|
|
| Method Summary | |
(package private) static void |
|
static JSPhandler |
getHandler(JSPservletPkg.ServletConfig sc,
java.lang.String contextPath,
JSPservletPkg.ServletContext ctx,
java.lang.String URI,
java.lang.String URIRealPath)
Returns the handling JSPhandler. |
static java.lang.String |
getJAR(JSPservletPkg.HttpServletRequest request)
service method for servlet using RequestDispatcher. |
(package private) static java.lang.String |
getPathInfo(JSPservletPkg.HttpServletRequest request,
boolean bContextPath)
Version 1.0.2. |
java.lang.String |
getServletInfo()
|
private java.io.PrintWriter |
getWriter(JSPservletPkg.HttpServletResponse response,
JSPhandler jh)
Version 1.0.3. |
(package private) void |
handleAbnormalCondition(JSPhandler handler,
JSPservletPkg.HttpServletResponse response,
int reason)
If an error page is defined returns this page. |
private void |
hrefUpdate(JSPhandler jh,
java.io.InputStream is,
JSPservletPkg.HttpServletRequest request,
JSPservletPkg.HttpServletResponse response,
java.lang.String jarName,
java.lang.String path,
BackCheck backCheck)
Version 1.0.3. href update of routing resources. Version 1.0.4. action update of routing resources. |
private int |
indexOfIgnoreCase(java.lang.String ln,
java.lang.String key)
Version 1.0.2. |
private void |
myService(JSPservletPkg.HttpServletRequest request,
JSPservletPkg.HttpServletResponse response,
java.lang.String contextPath,
JSPhandler jh)
invokes the target servlet or handles an update on behalf of JSPupdate. |
private void |
pwprintln(JSPhandler jh,
java.io.PrintWriter pw,
java.lang.String msg)
Version 1.0.2. |
void |
service(JSPservletPkg.HttpServletRequest request,
JSPservletPkg.HttpServletResponse response)
Version 1.0.4. |
static void |
setApplication()
Servlet container specific initialization. |
| Field Detail |
public static java.util.Map JSPhandlers
private static final java.text.SimpleDateFormat sdf
static int[] aReason
JSPhandler| Constructor Detail |
public JSPservlet()
| Method Detail |
static void()
public static final JSPhandler getHandler(JSPservletPkg.ServletConfig sc,
java.lang.String contextPath,
JSPservletPkg.ServletContext ctx,
java.lang.String URI,
java.lang.String URIRealPath)
throws JSPloaderException
In case of Resin, the JspFactory is normally not set at first call. This factory is used in JSPs compiled with Resin. I set it with Class.forName("com.caucho.jsp.QJspFactory").newInstance(). The code remains therefore portable across Java servers.
sc - ServletConfig used to initialize target classes.contextPath - application prefix.JSPhandlerpublic static final void setApplication()
final void handleAbnormalCondition(JSPhandler handler,
JSPservletPkg.HttpServletResponse response,
int reason)
throws java.io.IOException
handler - JSPhandler.response - HttpServletResponse.reason - error code.JSPhandler
public void service(JSPservletPkg.HttpServletRequest request,
JSPservletPkg.HttpServletResponse response)
throws JSPservletPkg.ServletException,
java.io.IOException
request - HttpServletRequest.response - HttpServletResponse.
private final java.io.PrintWriter getWriter(JSPservletPkg.HttpServletResponse response,
JSPhandler jh)
throws java.io.IOException
service method returning the response PrintWriter. Used in /ping and /info handling
response - HttpServletResponse.jh - handling JSPhandler.
private final void myService(JSPservletPkg.HttpServletRequest request,
JSPservletPkg.HttpServletResponse response,
java.lang.String contextPath,
JSPhandler jh)
throws JSPloaderException,
java.lang.ClassNotFoundException,
JSPservletPkg.ServletException,
java.io.IOException
myService is divided in:
a JSP can be invoked through RequestDispatcher.include. In this case request.getContextPath, request.getPathInfo point the including servlet and not the included server, whose info are returned by request.getAttribute("javax.servlet.include...").
So I first look at request.getAttribute("javax.servlet.include...") and then to request.getContextPath, request.getPathInfo.
request - HttpServletRequest.response - HttpServletResponse.contextPath - Context String retrieved from attribute (include) or
from request.jh - handling JSPhandler.JSPhandler
private void hrefUpdate(JSPhandler jh,
java.io.InputStream is,
JSPservletPkg.HttpServletRequest request,
JSPservletPkg.HttpServletResponse response,
java.lang.String jarName,
java.lang.String path,
BackCheck backCheck)
jh - handling JSPhandler.is - input stream on routing resource.request - HttpServletRequest.response - HttpServletResponse.jarName - archive name.path - path of routing resource.comment - purpose of routing resource.
private final int indexOfIgnoreCase(java.lang.String ln,
java.lang.String key)
ln - string where to find the string.key - string to find.
private final void pwprintln(JSPhandler jh,
java.io.PrintWriter pw,
java.lang.String msg)
jh - handling JSPhandler.pw - current print writer.
static final java.lang.String getPathInfo(JSPservletPkg.HttpServletRequest request,
boolean bContextPath)
request - HttpServletRequest.bContextPath - HttpServletRequest. If true, returns contextPath.
if false, returns pathInfo without context path.public static final java.lang.String getJAR(JSPservletPkg.HttpServletRequest request)
request - HttpServletRequest.public java.lang.String getServletInfo()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||