<%@ page language="java" %> <%@ page import="com.maff.forum.*,com.maff.forum.jsp.*" %> <%@ page session="false" %> Slots - Software Reality <%@ include file="/include/body.txt" %> <%@ include file="/design/table-top.txt" %> <%@ include file="/design/title.txt" %> <%@ include file="/include/navbar.txt" %> <%@ include file="/include/storytable-top.txt" %> Slots Web Framework <%@ include file="/include/storytable-mid.txt" %>

Slots Source Code

<< Slots Central

 

SlotWrapper.java

package com.felstar.slots;

import java.io.*;
import java.net.*;

import javax.servlet.*;
import javax.servlet.http.*;

import java.util.*;

/**
 *
 * @author  Default
 */
public class SlotWrapper extends HttpServletResponseWrapper{
    
    public SlotWrapper(HttpServletResponse response) {
     super(response); 
    }
    
    
    
    protected StringWriter stringWriter=new StringWriter()
    {
    };
    
    
    protected ServletOutputStream myServletOutputStream=new ServletOutputStream()
    {
      public void write(int c)  
      {
       stringWriter.write(c);  
      };
      public void close()
      {     
       //      super.close();   
      }
    };
   
    protected PrintWriter myPrintWriter=new PrintWriter(stringWriter)
    {  
     public void close()
     {     
      //      super.close();   
     }
     
    };
   
    public String include(HttpServletRequest request,String path) throws ServletException,IOException
    {
     RequestDispatcher disp=request.getRequestDispatcher(path);       
     disp.include(request,this);
     String st=getString();     
     clear();
     return st;
    }
    
    public String getString()
    {
     return stringWriter.toString();   
    }
    
    public void clear()
    {
     stringWriter.getBuffer().setLength(0);
    }
    
    public PrintWriter getWriter() throws IOException {        
        return myPrintWriter;
        
    }
      // resin 2.x calls getOutputStream, resin 3.x and tomcat 5.x call getWriter()    
    public ServletOutputStream getOutputStream()
                                    throws java.io.IOException
    {
      return myServletOutputStream;
    }
    
}


 

<< Slots Central

<< Software Reality Front Page

 

<%@ include file="/include/storytable-bot.txt" %> <%-- navbar2 --%> <%@ include file="/design/table-bot.txt" %>