You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by am...@apache.org on 2001/06/01 02:20:32 UTC
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets SsiInvokerServlet.java
amyroh 01/05/31 17:20:32
Modified: catalina/src/share/org/apache/catalina/servlets
SsiInvokerServlet.java
Log:
no message
Revision Changes Path
1.7 +16 -23 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java
Index: SsiInvokerServlet.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SsiInvokerServlet.java 2001/05/16 17:56:48 1.6
+++ SsiInvokerServlet.java 2001/06/01 00:20:31 1.7
@@ -1,8 +1,8 @@
/*
* SsiInvokerServlet.java
- * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v 1.6 2001/05/16 17:56:48 remm Exp $
- * $Revision: 1.6 $
- * $Date: 2001/05/16 17:56:48 $
+ * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v 1.7 2001/06/01 00:20:31 amyroh Exp $
+ * $Revision: 1.7 $
+ * $Date: 2001/06/01 00:20:31 $
*
* ====================================================================
*
@@ -99,7 +99,7 @@
*
* @author Bip Thelin
* @author Amy Roh
- * @version $Revision: 1.6 $, $Date: 2001/05/16 17:56:48 $
+ * @version $Revision: 1.7 $, $Date: 2001/06/01 00:20:31 $
*/
public final class SsiInvokerServlet extends HttpServlet {
/** Debug level for this servlet. */
@@ -213,7 +213,7 @@
ServletContext servletContext = getServletContext();
String path = getRelativePath(req);
- URL resource = servletContext.getResource(path);
+ URL resource = servletContext.getResource(path);
if (debug > 0)
log("SsiInvokerServlet.requestHandler()\n" +
@@ -241,12 +241,11 @@
}
OutputStream out = null;
- URLConnection resourceInfo = resource.openConnection();
+ URLConnection resourceInfo = resource.openConnection();
InputStream resourceInputStream = resourceInfo.getInputStream();
InputStream in = new BufferedInputStream(resourceInputStream, 4096);
- ByteArrayOutputStream soonOut =
- new ByteArrayOutputStream(resourceInfo.getContentLength());
+ ByteArrayOutputStream soonOut = new ByteArrayOutputStream(resourceInfo.getContentLength());
StringBuffer command = new StringBuffer();
byte buf[] = new byte[4096];
@@ -264,8 +263,7 @@
out = res.getOutputStream();
if (ssiMediator == null)
- ssiMediator =
- new SsiMediator(req, res, out, servletContext, debug, path, isVirtualWebappRelative);
+ ssiMediator = new SsiMediator(req, res, out, servletContext, debug, path, isVirtualWebappRelative);
else
ssiMediator.flush(req, res, out, servletContext, path, isVirtualWebappRelative);
@@ -277,8 +275,7 @@
soonOut = null; buf = null;
while (bIdx < unparsed.length) {
if (!inside) {
- if (unparsed[bIdx] == bStart[0]&&
- byteCmp(unparsed, bIdx, bStart)) {
+ if (unparsed[bIdx] == bStart[0]&& byteCmp(unparsed, bIdx, bStart)) {
inside = true;
bIdx += bStart.length;
command.delete(0, command.length());
@@ -287,8 +284,7 @@
out.write(unparsed[bIdx]);
bIdx++;
} else {
- if (unparsed[bIdx] == bEnd[0]&&
- byteCmp(unparsed, bIdx, bEnd)) {
+ if (unparsed[bIdx] == bEnd[0]&& byteCmp(unparsed, bIdx, bEnd)) {
inside = false;
bIdx += bEnd.length;
try {
@@ -301,17 +297,14 @@
strParamType = parseParamType(command, strCmd.length());
strParam = parseParam(command, strCmd.length());
- if(debug > 0)
- log("Serving SSI resource: " + strCmd);
+ if(debug > 0)
+ log("Serving SSI resource: " + strCmd);
ssiCommand = ssiMediator.getCommand(strCmd);
- if (ssiCommand != null&&
- strParamType.length==strParam.length&&
- strParamType.length>0) {
- if (ssiCommand.isPrintable())
- out.write((ssiCommand.getStream(strParamType,
- strParam)).getBytes());
- else
+ if (ssiCommand != null && strParamType.length==strParam.length&& strParamType.length>0) {
+ if (ssiCommand.isPrintable()) {
+ out.write((ssiCommand.getStream(strParamType, strParam)).getBytes());
+ } else
ssiCommand.process(strParamType, strParam);
} else {
out.write(ssiMediator.getError());