01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.core;
15:
16: import javax.servlet.ServletResponse;
17:
18: /**
19: * Is the ItsNat wrapper of the <code>javax.servlet.ServletResponse</code> object.
20: *
21: * @author Jose Maria Arranz Santamaria
22: */
23: public interface ItsNatServletResponse extends ItsNatUserData {
24: /**
25: * Returns the wrapped <code>javax.servlet.ServletResponse</code> object.
26: *
27: * @return the wrapped servlet response object. Can not be null.
28: */
29: public ServletResponse getServletResponse();
30:
31: /**
32: * Returns the ItsNat servlet associated to this response.
33: *
34: * @return the ItsNat servlet. Can not be null.
35: */
36: public ItsNatServlet getItsNatServlet();
37:
38: /**
39: * Returns the ItsNat session associated to this response.
40: *
41: * @return the ItsNat session. Can not be null.
42: */
43: public ItsNatSession getItsNatSession();
44:
45: /**
46: * Returns the ItsNat document associated to this response.
47: *
48: * @return the ItsNat document. If null no document could be loaded/accessed.
49: */
50: public ItsNatDocument getItsNatDocument();
51:
52: /**
53: * Add JavaScript code to send to the client as return of this request.
54: *
55: * <p>If this request is a document load request, the code is added to the JavaScript
56: * initialization code, otherwise is a AJAX based request and the code is added to the
57: * JavaScript event response.</p>
58: *
59: * <p>Use this method exceptionally if you need to send custom code in this circumstance
60: * otherwise use {@link ItsNatDocument#addCodeToSend(Object)}</p>
61: *
62: * @param code the code to send, <code>Object.toString()</code> is called to convert to string.
63: * @see org.itsnat.core.script.ScriptUtil
64: */
65: public void addCodeToSend(String code);
66: }
|