01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.vfny.geoserver.config.web.tiles.taglib;
06:
07: /**
08: * EXPERIMENT FOR THE UI Modularization
09: *
10: * @author fabiania
11: *
12: */
13: public class ExtResInsertTag /*extends InsertTag*/{
14: /**
15: *
16: */
17:
18: /*
19: private static final long serialVersionUID = -8363215424989241582L;
20:
21: */
22:
23: /**
24: * Do an include of specified page.
25: * This method is used internally to do all includes from this class. It delegates
26: * the include call to the TilesUtil.doInclude().
27: * @param page The page that will be included
28: * @throws ServletException - Thrown by call to pageContext.include()
29: * @throws IOException - Thrown by call to pageContext.include()
30: */
31:
32: /*
33: protected void doInclude(String page)
34: throws ServletException, IOException {
35: //TilesUtil.doInclude(page, pageContext);
36: final JspAwareRequestContext jsp = new JspAwareRequestContext(pageContext);
37: jsp.
38: try {
39: URL u = pageContext.getServletContext().getResource(page);
40: if (u != null) {
41: this.processUrl(u.toString());
42: }
43: } catch (Exception e) {
44: System.out.println("include problem: " + e.getMessage());
45: }
46: try {
47: URL u = pageContext.getServletContext().getResource(page);
48: if (u != null) {
49: final ByteToCharConverter btc = ByteToCharConverter.getDefault();
50: InputStream in = (InputStream)u.getContent();
51: byte[] buf = new byte[255];
52: int numRead = in.read(buf);
53: while (numRead != -1) {
54: pageContext.getOut().write(btc.convertAll(buf), 0, numRead);
55: numRead = in.read(buf);
56: }
57: }
58: }
59: catch (Exception e) {
60: System.out.println("include problem: " + e.getMessage());
61: }
62: }*/
63: }
|