View Javadoc
1 /* 2 * Scope: a generic MVC framework. 3 * Copyright (c) 2000-2002, Steve Meyfroidt 4 * All rights reserved. 5 * Email: smeyfroi@users.sourceforge.net 6 * 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 12 * Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 15 * Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in the 17 * documentation and/or other materials provided with the distribution. 18 * 19 * Neither the name "Scope" nor the names of its contributors 20 * may be used to endorse or promote products derived from this software 21 * without specific prior written permission. 22 * 23 * 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR 28 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 29 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 30 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 31 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 32 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 33 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 * 36 * 37 * $Id: DummyPage.java,v 1.6 2002/06/17 09:56:00 ludovicc Exp $ 38 */ 39 40 41 package test.controller.servlet; 42 43 44 import java.io.OutputStream; 45 import java.io.PrintStream; 46 import java.io.PrintWriter; 47 import java.io.Writer; 48 import org.apache.commons.logging.LogFactory;import org.apache.commons.logging.Log; 49 import org.scopemvc.core.PropertyManager; 50 import org.scopemvc.core.Selector; 51 import org.scopemvc.view.servlet.xml.XSLPage; 52 53 54 /*** 55 * <P> 56 * A ServletView that sends the bound model property 57 * into the output stream. 58 * </P> 59 * 60 * @author <A HREF="mailto:smeyfroi@users.sourceforge.net">Steve Meyfroidt</A> 61 * @version $Revision: 1.6 $ $Date: 2002/06/17 09:56:00 $ 62 */ 63 class DummyPage extends XSLPage { 64 private static final Log LOG = LogFactory.getLog(DummyPage.class); 65 public DummyPage(String inID) { 66 super(inID, null); 67 } 68 public void streamView(OutputStream stream) throws Exception { 69 LOG.debug("streamView"); 70 PropertyManager manager = PropertyManager.getInstance(getBoundModel()); 71 Object o = manager.get(getBoundModel(), getSelector()); 72 if (LOG.isDebugEnabled()) LOG.debug("streamView: " + o); 73 PrintStream ps = new PrintStream(stream); 74 ps.print(o.toString()); 75 ps.flush(); 76 } 77 public String getContentType() { 78 return "text/text"; 79 } 80 // support test of streamView 81 private Selector selector; 82 public void setSelector(Selector inSelector) { 83 selector = inSelector; 84 } 85 public Selector getSelector() { 86 return selector; 87 } 88 } 89

This page was automatically generated by Maven