01: package org.gomba.domains;
02:
03: import org.gomba.ParameterDefinition;
04: import org.gomba.ParameterDomain;
05: import org.gomba.ParameterResolver;
06:
07: /**
08: * This domain contains properties extracted from the servlet request
09: * attributes. Request attributes can be set by the JSP that generates the
10: * dynamic SQL.
11: *
12: * @author Flavio Tordini
13: * @version $Id: RequestScopeDomain.java,v 1.1.1.1 2004/06/16 13:15:12 flaviotordini Exp $
14: */
15: public class RequestScopeDomain implements ParameterDomain {
16:
17: /**
18: * @see org.gomba.ParameterDomain#getParameterValue(org.gomba.ParameterResolver,
19: * org.gomba.ParameterDefinition)
20: */
21: public Object getParameterValue(ParameterResolver context,
22: ParameterDefinition parameter) {
23: return context.getRequest().getAttribute(parameter.getName());
24: }
25:
26: /**
27: * @see org.gomba.ParameterDomain#getName()
28: */
29: public String getName() {
30: return "requestScope";
31: }
32: }
|