Software Reality
Programming with
a dose of satire.

Site Map Search


Agile Development
 
Extreme Programming
 
Code Generation


Articles
Lifecycle
Design
Programming
Soapbox
Reviews
Cthulhu

Check out our ageing Reviews Section


Use Case Driven
Use Case Driven Object Modeling with UML: Theory and Practice
Get from use cases to working, maintainable source code. Examples use Spring Framework, JUnit and Enterprise Architect

Agile UML
Agile Development with ICONIX Process
A practical subset of agile development techniques, illustrated by example

Get Controversial!
Extreme Programming Refactored
Extreme Programming with a dose of satire
Available now:



ICONIX/Sparx Public Classes to Come to London

ICONIX is planning a series of open- enrollment public classes entitled Hands-On Enterprise Architect for Power Users in collaboration with Sparx Systems.




Slots Web Framework

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

 

All trademarks and copyrights on this page are owned by their respective owners.
Stories and articles are owned by the original author.
All the rest Copyright © 1998-2007 Matt Stephens. ALL RIGHTS RESERVED.