atg.droplet
Class BeanProperty
java.lang.Object
atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.nucleus.TimedOperationService
atg.nucleus.servlet.ServletService
atg.nucleus.servlet.HttpServletService
atg.servlet.DynamoServlet
atg.droplet.BeanProperty
- All Implemented Interfaces:
- NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, ParameterServlet, java.util.EventListener, javax.servlet.Servlet
public class BeanProperty
- extends DynamoServlet
This servlet gets or sets a property in a bean. The bean is defined
by the bean parameter. The property to get or set is defined by the
propertyName parameter. The value may be set or read using the
propertyValue parameter. In either case, the droplet renders an
oparam named output.
Examples:
To set the property value, specify the new value using the propertyValue
parameter, as in this example:
<droplet bean="/atg/dynamo/droplet/BeanProperty">
<param name="bean" value="param:myBean">
<param name="propertyName" value="color">
<param name="propertyValue" value="red">
</droplet>
When setting property values the oparam need not be used, since there's
no need to render output within the droplet's context.
To get the property value, leave the propertyValue parameter unset. The
parameter will then take on the current value within the output oparam,
as in this example:
<droplet bean="/atg/dynamo/droplet/BeanProperty">
<param name="bean" value="param:myBean">
<param name="propertyName" value="color">
<oparam name="output">
The bean's color is <valueof param="propertyValue">unset</valueof>.
</oparam>
</droplet>
Dotted subproperty expressions of the form "a.b.c" are permitted when
getting a property value, though not when setting one. When getting a
value using subproperty expressions, if any intermediate property is
null then propertyValue will also be null, as is the case when using
DynamicBeans
.
- See Also:
DynamicBeans
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
DEFAULT_LOG_TRACE_STATUS |
Constructor Summary |
BeanProperty()
Constructs an instanceof BeanProperty |
Methods inherited from class atg.nucleus.GenericService |
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CLASS_VERSION
public static java.lang.String CLASS_VERSION
- Class version string
BEAN
public static final java.lang.String BEAN
- See Also:
- Constant Field Values
PROPERTY
public static final java.lang.String PROPERTY
- See Also:
- Constant Field Values
VALUE
public static final java.lang.String VALUE
- See Also:
- Constant Field Values
OUTPUT
public static final java.lang.String OUTPUT
- See Also:
- Constant Field Values
BEANRESOURCES
protected static final java.lang.String BEANRESOURCES
- See Also:
- Constant Field Values
sResourceBundle
protected static java.util.ResourceBundle sResourceBundle
BeanProperty
public BeanProperty()
- Constructs an instanceof BeanProperty
service
public void service(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
throws javax.servlet.ServletException,
java.io.IOException
- Service the servlets request. If the input indicates a get request
the serviceGet method is called if the input indicates a set request
then the serviceSet method is called.
- Overrides:
service
in class DynamoServlet
- Parameters:
pRequest
- the servlet's requestpResponse
- the servlet's response
- Throws:
javax.servlet.ServletException
- if there was an error while executing the code
java.io.IOException
- if there was an error with servlet io
serviceGet
protected void serviceGet(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse,
java.lang.Object pBean,
java.lang.String pProperty,
java.lang.Object pValue)
throws javax.servlet.ServletException,
java.io.IOException
- Handles a request to get a property
- Parameters:
pRequest
- the servlet's requestpResponse
- the servlet's responsepBean
- the bean to operate onpProperty
- the property to getpValue
- the value of this property
- Throws:
javax.servlet.ServletException
- if there was an error while executing the code
java.io.IOException
- if there was an error with servlet io
serviceSet
protected void serviceSet(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse,
java.lang.Object pBean,
java.lang.String pProperty,
java.lang.Object pValue)
throws javax.servlet.ServletException,
java.io.IOException
- handles a request to set a property
- Parameters:
pRequest
- the servlet's requestpResponse
- the servlet's responsepBean
- the bean to operate onpProperty
- the property to setpValue
- the value to set this property to
- Throws:
javax.servlet.ServletException
- if there was an error while executing the code
java.io.IOException
- if there was an error with servlet io