CPPSERV


Home Projects Jobs Clientele Contact
CPPSERV Documentation Download TODO Mailing lists Bug tracker News RSS Feed Browse source

container::serverconfig::AppContext Class Reference

#include <appcontext.h>

Inheritance diagram for container::serverconfig::AppContext:
Collaboration diagram for container::serverconfig::AppContext:

List of all members.


Classes

struct  ServletDesc
class  SessionCleaner

Public Types

typedef ServletMap< ServletDescservletmap_t

Public Member Functions

 ~AppContext ()
GlobalContextgetGlobalContext ()
ServletConfigImpladdServlet (const std::string &path, const std::string &name, const std::string &dso, bool hidden, size_t maxRequestSize, size_t maxFileSize)
void delServlet (const std::string &path)
ServletContainergetServletContainer (const std::string &path)
void initServlets ()
void destroyServlets ()
HttpSessionImplgetSession (const std::string &sid, bool create)
 Indicates whether to allow proxies to catch documents by default.
const std::string & getSessionCookieName ()
void killSession (const std::string &sid)
void cleanSessions ()
bool isSessionValid (const std::string &sid)
void addInitParam (const std::string &name, const std::string &value)
void killAllSessions ()
const std::string & getFileSaveTemplate () const
const std::string & getUriBase () const
virtual servlet::ServletContextgetContext (const std::string &uripath)
virtual int getMajorVersion ()
virtual int getMinorVersion ()
virtual std::string getMimeType (const std::string &file)
virtual std::auto_ptr
< std::set< std::string > > 
getResourcePaths (const std::string &path)
virtual std::string getResource (const std::string &path)
virtual std::istream & getResourceAsStream (const std::string &path)
virtual
servlet::RequestDispatcher
getRequestDispatcher (const std::string &path)
virtual
servlet::RequestDispatcher
getNamedDispatcher (const std::string &name)
virtual void log (const std::string &msg) const
virtual void log (const std::string &message, const std::exception &e) const
virtual std::string getRealPath (const std::string &path)
virtual std::string getServerInfo ()
virtual std::string getInitParameter (const std::string &name)
virtual std::auto_ptr
< std::vector< std::string > > 
getInitParameterNames ()
virtual boost::shared_ptr< void > getAttribute (const std::string &name)
virtual std::auto_ptr
< std::vector< std::string > > 
getAttributeNames ()
virtual void setAttribute (const std::string &name, boost::shared_ptr< void > object)
virtual void removeAttribute (const std::string &name)
virtual bool hasAttribute (const std::string &name) const
virtual std::string getServletContextName () const

Static Public Member Functions

static ContextcontextCreator (const ConfigNode &node, Context *parent)

Protected Member Functions

virtual bool onSetParam (const ConfigNode &)
virtual ContextgetContext (const ConfigNode &node)
virtual bool onPreComplete ()
virtual bool onPostComplete ()
bool setSessionTimeout (const ConfigNode &)
bool setUploadDir (const ConfigNode &)
bool addInitParam (const ConfigNode &)
bool setPhysBase (const ConfigNode &)
bool setDefaultMimeType (const ConfigNode &)
bool setDefaultCharacterEncoding (const ConfigNode &)
bool setUriBase (const ConfigNode &)

Private Types

typedef std::map< std::string,
HttpSessionImpl * > 
sessionlist_t
typedef std::map< std::string,
boost::shared_ptr< void > > 
attr_t
typedef std::map< std::string,
std::string > 
param_t
typedef servlet::Servlet *(* servletcreatefunc_t )()

Private Member Functions

 AppContext (const ConfigNode &node, Context *parent)
void unloadServlet (const std::string &path)
ServletDescgetDesc (const std::string &path)
void initServlet (const std::string &path)
void destroyServlet (const std::string &path)
HttpSessionImplnewSession ()

Static Private Member Functions

static void registerParams (ParamRegistry< AppContext > &)
static void registerContexts (ContextRegistry &)
static void splitServPath (const std::string &path, std::string &dir, std::string &name)
static std::string makeSName (const std::string &name)

Private Attributes

time_t m_sessionTimeout
std::string m_uploadDir
util::pairlist_t m_init_params
servletmap_t m_maptop
SessionCleanerm_cleaner
sessionlist_t m_sessions
std::string m_sessionCookieName
std::string m_fileSaveTemplate
sptk::CWaiter m_sessionLock
attr_t m_attrs
param_t m_params
std::string m_uribase
std::string m_physbase
std::string m_mime
std::string m_enc
bool m_cache

Static Private Attributes

static ContextRegistry m_contextregistry
static ParamRegistry< AppContextm_paramregistry

Detailed Description

Holds Application object. Applications contain servlets, sessions, app-level parameters, etc.

Definition at line 48 of file appcontext.h.


Member Typedef Documentation

typedef std::map<std::string,boost::shared_ptr<void> > container::serverconfig::AppContext::attr_t [private]

Definition at line 132 of file appcontext.h.

typedef std::map<std::string,std::string> container::serverconfig::AppContext::param_t [private]

Definition at line 134 of file appcontext.h.

typedef std::map<std::string, HttpSessionImpl*> container::serverconfig::AppContext::sessionlist_t [private]

Definition at line 127 of file appcontext.h.


Constructor & Destructor Documentation

container::serverconfig::AppContext::AppContext ( const ConfigNode node,
Context parent 
) [private]

container::serverconfig::AppContext::~AppContext (  ) 


Member Function Documentation

void container::serverconfig::AppContext::addInitParam ( const std::string &  name,
const std::string &  value 
)

Definition at line 469 of file appcontext.cpp.

References m_params.

bool container::serverconfig::AppContext::addInitParam ( const ConfigNode val  )  [protected]

Definition at line 166 of file appcontext.cpp.

References container::serverconfig::ConfigNode::getAttrs(), and m_init_params.

Referenced by onPreComplete(), and registerParams().

Here is the call graph for this function:

ServletConfigImpl * container::serverconfig::AppContext::addServlet ( const std::string &  path,
const std::string &  name,
const std::string &  dso,
bool  hidden,
size_t  maxRequestSize,
size_t  maxFileSize 
)

void container::serverconfig::AppContext::cleanSessions (  ) 

Definition at line 380 of file appcontext.cpp.

References killSession(), m_sessionLock, and m_sessions.

Referenced by container::serverconfig::AppContext::AppContext::SessionCleaner::threadFunction().

Here is the call graph for this function:

static Context* container::serverconfig::AppContext::contextCreator ( const ConfigNode node,
Context parent 
) [inline, static]

Definition at line 76 of file appcontext.h.

References AppContext().

Referenced by container::serverconfig::GlobalContext::registerContexts().

Here is the call graph for this function:

void container::serverconfig::AppContext::delServlet ( const std::string &  path  ) 

Definition at line 250 of file appcontext.cpp.

References m_maptop, and container::ServletMap< T >::removeDesc().

Referenced by addServlet().

Here is the call graph for this function:

void container::serverconfig::AppContext::destroyServlet ( const std::string &  path  )  [private]

Definition at line 281 of file appcontext.cpp.

References container::ServletContainer::destroy(), and getServletContainer().

Referenced by destroyServlets().

Here is the call graph for this function:

void container::serverconfig::AppContext::destroyServlets (  ) 

Definition at line 311 of file appcontext.cpp.

References destroyServlet(), container::ServletMap< T >::forEachServletPath(), and m_maptop.

Referenced by ~AppContext().

Here is the call graph for this function:

boost::shared_ptr< void > container::serverconfig::AppContext::getAttribute ( const std::string &  name  )  [virtual]

Returns the servlet container attribute with the given name, or null if there is no attribute by that name. An attribute allows a servlet container to give the servlet additional information not already provided by this interface. See your server documentation for information about its attributes. A list of supported attributes can be retrieved using getAttributeNames.

The attribute is returned as a java.lang.Object or some subclass. Attribute names should follow the same convention as package names. The Java Servlet API specification reserves names matching java.*, javax.*, and sun.*.

Parameters:
name a String specifying the name of the attribute
Returns:
an Object containing the value of the attribute, or null if no attribute exists matching the given name
See also:
ServletContext::getAttributeNames

Implements servlet::ServletContext.

Definition at line 641 of file appcontext.cpp.

References m_attrs.

std::auto_ptr< std::vector< std::string > > container::serverconfig::AppContext::getAttributeNames (  )  [virtual]

Returns an Enumeration containing the attribute names available within this servlet context. Use the getAttribute method with an attribute name to get the value of an attribute.

Returns:
an Enumeration of attribute names
See also:
getAttribute

Implements servlet::ServletContext.

Definition at line 649 of file appcontext.cpp.

References container::util::getMapKeyNames(), and m_attrs.

Here is the call graph for this function:

servlet::ServletContext * container::serverconfig::AppContext::getContext ( const std::string &  uripath  )  [virtual]

Returns a ServletContext object that corresponds to a specified URL on the server.

This method allows servlets to gain access to the context for various parts of the server, and as needed obtain servlet::RequestDispatcher objects from the context. The given path must be begin with "/", is interpreted relative to the server's document root and is matched against the context roots of other web applications hosted on this container.

In a security conscious environment, the servlet container may return null for a given URL.

Parameters:
uripath a String specifying the context path of another web application in the container.
Returns:
the ServletContext object that corresponds to the named URL, or null if either none exists or the container wishes to restrict this access.
See also:
RequestDispatcher

Implements servlet::ServletContext.

Definition at line 536 of file appcontext.cpp.

References container::serverconfig::ServerConfig::getApp(), container::serverconfig::Context::getServerConfig(), and getUriBase().

Here is the call graph for this function:

virtual Context* container::serverconfig::AppContext::getContext ( const ConfigNode node  )  [inline, protected, virtual]

Implements container::serverconfig::Context.

Definition at line 61 of file appcontext.h.

References container::serverconfig::ContextRegistry::getContext(), and m_contextregistry.

Here is the call graph for this function:

AppContext::ServletDesc * container::serverconfig::AppContext::getDesc ( const std::string &  path  )  [private]

Definition at line 245 of file appcontext.cpp.

References container::ServletMap< T >::getServletDesc(), and m_maptop.

Referenced by addServlet(), getServletContainer(), and unloadServlet().

Here is the call graph for this function:

const std::string& container::serverconfig::AppContext::getFileSaveTemplate (  )  const [inline]

Definition at line 173 of file appcontext.h.

References m_fileSaveTemplate.

Referenced by container::HttpServletRequestImpl::getFileSaveTemplate().

GlobalContext* container::serverconfig::AppContext::getGlobalContext (  )  [inline]

Definition at line 78 of file appcontext.h.

References container::serverconfig::Context::getParent().

Referenced by onPreComplete().

Here is the call graph for this function:

std::string container::serverconfig::AppContext::getInitParameter ( const std::string &  name  )  [virtual]

Returns a String containing the value of the named context-wide initialization parameter, or null if the parameter does not exist.

This method can make available configuration information useful to an entire "web application". For example, it can provide a webmaster's email address or the name of a system that holds critical data.

Parameters:
name a String containing the name of the parameter whose value is requested
Returns:
a String containing at least the servlet container name and version number
See also:
ServletConfig::getInitParameter

Implements servlet::ServletContext.

Definition at line 629 of file appcontext.cpp.

References m_params.

std::auto_ptr< std::vector< std::string > > container::serverconfig::AppContext::getInitParameterNames (  )  [virtual]

Returns the names of the context's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the context has no initialization parameters.

Returns:
an Enumeration of String objects containing the names of the context's initialization parameters
See also:
ServletConfig::getInitParameter

Implements servlet::ServletContext.

Definition at line 637 of file appcontext.cpp.

References container::util::getMapKeyNames(), and m_params.

Here is the call graph for this function:

int container::serverconfig::AppContext::getMajorVersion (  )  [virtual]

Returns the major version of the Java Servlet API that this servlet container supports. All implementations that comply with Version 2.4 must have this method return the integer 2.

Returns:
2

Implements servlet::ServletContext.

Definition at line 544 of file appcontext.cpp.

std::string container::serverconfig::AppContext::getMimeType ( const std::string &  file  )  [virtual]

Returns the MIME type of the specified file, or null if the MIME type is not known. The MIME type is determined by the configuration of the servlet container, and may be specified in a web application deployment descriptor. Common MIME types are "text/html" and "image/gif".

Parameters:
file a String specifying the name of a file
Returns:
a String specifying the file's MIME type

Implements servlet::ServletContext.

Definition at line 552 of file appcontext.cpp.

int container::serverconfig::AppContext::getMinorVersion (  )  [virtual]

Returns the minor version of the Servlet API that this servlet container supports. All implementations that comply with Version 2.4 must have this method return the integer 4.

Returns:
4

Implements servlet::ServletContext.

Definition at line 548 of file appcontext.cpp.

servlet::RequestDispatcher * container::serverconfig::AppContext::getNamedDispatcher ( const std::string &  name  )  [virtual]

Returns a servlet::RequestDispatcher object that acts as a wrapper for the named servlet.

Servlets (and JSP pages also) may be given names via server administration or via a web application deployment descriptor. A servlet instance can determine its name using servlet::ServletConfig#getServletName.

This method returns null if the ServletContext cannot return a RequestDispatcher for any reason.

Parameters:
name a String specifying the name of a servlet to wrap
Returns:
a RequestDispatcher object that acts as a wrapper for the named servlet, or null if the ServletContext cannot return a RequestDispatcher
See also:
RequestDispatcher

ServletContext::getContext

ServletConfig::getServletName

Implements servlet::ServletContext.

Definition at line 609 of file appcontext.cpp.

References getServletContainer().

Here is the call graph for this function:

std::string container::serverconfig::AppContext::getRealPath ( const std::string &  path  )  [virtual]

Returns a String containing the real path for a given virtual path. For example, the path "/index.html" returns the absolute file path on the server's filesystem would be served by a request for "http://host/contextPath/index.html", where contextPath is the context path of this ServletContext..

The real path returned will be in a form appropriate to the computer and operating system on which the servlet container is running, including the proper path separators. This method returns null if the servlet container cannot translate the virtual path to a real path for any reason (such as when the content is being made available from a .war archive).

Parameters:
path a String specifying a virtual path
Returns:
a String specifying the real path, or null if the translation cannot be performed

Implements servlet::ServletContext.

Definition at line 613 of file appcontext.cpp.

References m_physbase.

Referenced by container::HttpServletRequestImpl::getPathTranslated().

servlet::RequestDispatcher * container::serverconfig::AppContext::getRequestDispatcher ( const std::string &  path  )  [virtual]

Returns a servlet::RequestDispatcher object that acts as a wrapper for the resource located at the given path. A RequestDispatcher object can be used to forward a request to the resource or to include the resource in a response. The resource can be dynamic or static.

The pathname must begin with a "/" and is interpreted as relative to the current context root. Use getContext to obtain a RequestDispatcher for resources in foreign contexts. This method returns null if the ServletContext cannot return a RequestDispatcher.

Parameters:
path a String specifying the pathname to the resource
Returns:
a RequestDispatcher object that acts as a wrapper for the resource at the specified path, or null if the ServletContext cannot return a RequestDispatcher
See also:
servlet::RequestDispatcher

servlet::ServletContext::getContext

Implements servlet::ServletContext.

Definition at line 602 of file appcontext.cpp.

References getServletContainer().

Referenced by container::HttpServletRequestImpl::getRequestDispatcher().

Here is the call graph for this function:

std::string container::serverconfig::AppContext::getResource ( const std::string &  path  )  [virtual]

Returns a URL to the resource that is mapped to a specified path. The path must begin with a "/" and is interpreted as relative to the current context root.

This method allows the servlet container to make a resource available to servlets from any source. Resources can be located on a local or remote file system, in a database, or in a .war file.

The servlet container must implement the URL handlers and URLConnection objects that are necessary to access the resource.

This method returns null if no resource is mapped to the pathname.

Some containers may allow writing to the URL returned by this method using the methods of the URL class.

The resource content is returned directly, so be aware that requesting a .jsp page returns the JSP source code. Use a RequestDispatcher instead to include results of an execution.

This method has a different purpose than java.lang.Class.getResource, which looks up resources based on a class loader. This method does not use class loaders.

Parameters:
path a String specifying the path to the resource
Returns:
the resource located at the named path, or null if there is no resource at that path
Exceptions:
MalformedURLException if the pathname is not given in the correct form

Implements servlet::ServletContext.

Definition at line 593 of file appcontext.cpp.

std::istream & container::serverconfig::AppContext::getResourceAsStream ( const std::string &  path  )  [virtual]

Returns the resource located at the named path as an InputStream object.

The data in the InputStream can be of any type or length. The path must be specified according to the rules given in getResource. This method returns null if no resource exists at the specified path.

Meta-information such as content length and content type that is available via getResource method is lost when using this method.

The servlet container must implement the URL handlers and URLConnection objects necessary to access the resource.

This method is different from java.lang.Class.getResourceAsStream, which uses a class loader. This method allows servlet containers to make a resource available to a servlet from any location, without using a class loader.

Parameters:
path a String specifying the path to the resource
Returns:
the InputStream returned to the servlet, or null if no resource exists at the specified path

Implements servlet::ServletContext.

Definition at line 598 of file appcontext.cpp.

std::auto_ptr< std::set< std::string > > container::serverconfig::AppContext::getResourcePaths ( const std::string &  path  )  [virtual]

Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path matches the supplied path argument. Paths indicating subdirectory paths end with a '/'. The returned paths are all relative to the root of the web application and have a leading '/'. For example, for a web application containing<br>

/welcome.html
/catalog/index.html
/catalog/products.html
/catalog/offers/books.html
/catalog/offers/music.html
/customer/login.jsp
/WEB-INF/web.xml
/WEB-INF/classes/com.acme.OrderServlet.class,

getResourcePaths("/") returns {"/welcome.html", "/catalog/", "/customer/", "/WEB-INF/"}
getResourcePaths("/catalog/") returns {"/catalog/index.html", "/catalog/products.html", "/catalog/offers/"}.

Parameters:
path the partial path used to match the resources, which must start with a /
Returns:
a Set containing the directory listing, or null if there are no resources in the web application whose path begins with the supplied path.
Since:
Servlet 2.3

Implements servlet::ServletContext.

Definition at line 580 of file appcontext.cpp.

References container::ServletMap< T >::getPath(), container::ServletMap< T >::getServlets(), container::ServletMap< T >::getSubpaths(), and m_maptop.

Here is the call graph for this function:

std::string container::serverconfig::AppContext::getServerInfo (  )  [virtual]

Returns the name and version of the servlet container on which the servlet is running.

The form of the returned string is servername/versionnumber. For example, the JavaServer Web Development Kit may return the string JavaServer Web Dev Kit/1.0.

The servlet container may return other optional information after the primary string in parentheses, for example, JavaServer Web Dev Kit/1.0 (JDK 1.1.6; Windows NT 4.0 x86).

Returns:
a String containing at least the servlet container name and version number

Implements servlet::ServletContext.

Definition at line 625 of file appcontext.cpp.

References CPPSERV_VERSION.

ServletContainer * container::serverconfig::AppContext::getServletContainer ( const std::string &  path  ) 

std::string container::serverconfig::AppContext::getServletContextName (  )  const [virtual]

Returns:
Contest's name (which is same as application name)

Implements servlet::ServletContext.

Definition at line 478 of file appcontext.cpp.

References container::serverconfig::Context::getName().

Referenced by addServlet(), container::ServletContainer::forward(), container::HttpServletRequestImpl::getContextPath(), and container::HttpServletRequestImpl::getSession().

Here is the call graph for this function:

container::HttpSessionImpl * container::serverconfig::AppContext::getSession ( const std::string &  sid,
bool  create 
)

Indicates whether to allow proxies to catch documents by default.

Parameters:
sid Session ID. If empty string, new session is created
create Whether to create session if it doesn't exist
Returns:
Pointer to the session.
Note:
sets session state to not-new when sid is not empty This presumes session is only retrieved from Context once per request

Definition at line 327 of file appcontext.cpp.

References m_sessionLock, m_sessions, newSession(), and container::HttpSessionImpl::notNew().

Referenced by container::HttpServletRequestImpl::getSession(), and container::HttpServletRequestImpl::isRequestedSessionIdValid().

Here is the call graph for this function:

container::serverconfig::AppContext::getSessionCookieName (  )  [inline]

const std::string& container::serverconfig::AppContext::getUriBase (  )  const [inline]

bool container::serverconfig::AppContext::hasAttribute ( const std::string &  name  )  const [virtual]

[C++ Servlet API Extention]

Returns the false if no attribute of the given name exists. Returns true otherwize

Parameters:
name a String specifying the name of the attribute
Returns:
false if the attribute does not exist. true otherwize

Implements servlet::ServletContext.

Definition at line 663 of file appcontext.cpp.

References m_attrs.

void container::serverconfig::AppContext::initServlet ( const std::string &  path  )  [private]

Definition at line 275 of file appcontext.cpp.

References getServletContainer(), and container::ServletContainer::init().

Referenced by initServlets().

Here is the call graph for this function:

void container::serverconfig::AppContext::initServlets (  ) 

Definition at line 304 of file appcontext.cpp.

References container::ServletMap< T >::forEachServletPath(), initServlet(), and m_maptop.

Referenced by onPostComplete().

Here is the call graph for this function:

bool container::serverconfig::AppContext::isSessionValid ( const std::string &  sid  ) 

Parameters:
sid Session ID, as retrieved from session cookie. Session is valid if it exists and did not expire.

Definition at line 459 of file appcontext.cpp.

References m_sessions.

Referenced by container::HttpServletRequestImpl::isRequestedSessionIdValid().

void container::serverconfig::AppContext::killAllSessions (  ) 

Removes all sessions in this context. It presumes no servlets in this context are going to use us.

Definition at line 512 of file appcontext.cpp.

References m_sessionLock, and m_sessions.

Referenced by ~AppContext().

void container::serverconfig::AppContext::killSession ( const std::string &  sid  ) 

Parameters:
sid ID of session to kill
Note:
This function should always be called with sessionLock held.

Definition at line 366 of file appcontext.cpp.

References m_sessions.

Referenced by cleanSessions().

void container::serverconfig::AppContext::log ( const std::string &  message,
const std::exception &  e 
) const [virtual]

Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file. The name and type of the servlet log file is specific to the servlet container, usually an event log.

Parameters:
message a std::string that describes the error or exception
e the std::exception error or exception

Implements servlet::ServletContext.

Definition at line 488 of file appcontext.cpp.

References log().

Here is the call graph for this function:

void container::serverconfig::AppContext::log ( const std::string &  msg  )  const [virtual]

Writes the specified message to a servlet log file, usually an event log. The name and type of the servlet log file is specific to the servlet container.

Parameters:
msg a String specifying the message to be written to the log file

Implements servlet::ServletContext.

Definition at line 483 of file appcontext.cpp.

Referenced by log().

std::string container::serverconfig::AppContext::makeSName ( const std::string &  name  )  [static, private]

Definition at line 523 of file appcontext.cpp.

Referenced by onPreComplete().

container::HttpSessionImpl * container::serverconfig::AppContext::newSession (  )  [private]

This function must always be called with sessionLock locked.

Definition at line 352 of file appcontext.cpp.

References container::util::getRandomString(), m_sessions, and m_sessionTimeout.

Referenced by getSession().

Here is the call graph for this function:

bool container::serverconfig::AppContext::onPostComplete (  )  [protected, virtual]

called after child contexts' complete()

Reimplemented from container::serverconfig::Context.

Definition at line 197 of file appcontext.cpp.

References initServlets(), m_cleaner, m_fileSaveTemplate, m_sessionTimeout, and m_uploadDir.

Here is the call graph for this function:

bool container::serverconfig::AppContext::onPreComplete (  )  [protected, virtual]

bool container::serverconfig::AppContext::onSetParam ( const ConfigNode node  )  [protected, virtual]

Implements container::serverconfig::Context.

Definition at line 83 of file appcontext.cpp.

References m_paramregistry, and container::serverconfig::ParamRegistry< T >::setParam().

Here is the call graph for this function:

void container::serverconfig::AppContext::registerContexts ( ContextRegistry reg  )  [static, private]

void container::serverconfig::AppContext::removeAttribute ( const std::string &  name  )  [virtual]

Removes the attribute with the given name from the servlet context. After removal, subsequent calls to getAttribute to retrieve the attribute's value will return null.

If listeners are configured on the ServletContext the container notifies them accordingly.

Parameters:
name a String specifying the name of the attribute to be removed

Implements servlet::ServletContext.

Definition at line 657 of file appcontext.cpp.

References m_attrs.

void container::serverconfig::AppContext::setAttribute ( const std::string &  name,
boost::shared_ptr< void >  object 
) [virtual]

Binds an object to a given attribute name in this servlet context. If the name specified is already used for an attribute, this method will replace the attribute with the new to the new attribute.

If listeners are configured on the ServletContext the container notifies them accordingly.

If a null value is passed, the effect is the same as calling removeAttribute().

Attribute names should follow the same convention as package names. The Java Servlet API specification reserves names matching java.*, javax.*, and sun.*.

Parameters:
name a String specifying the name of the attribute
object an Object representing the attribute to be bound

Implements servlet::ServletContext.

Definition at line 653 of file appcontext.cpp.

References m_attrs.

bool container::serverconfig::AppContext::setDefaultCharacterEncoding ( const ConfigNode val  )  [protected]

Definition at line 161 of file appcontext.cpp.

References m_enc, and container::serverconfig::Context::setString().

Referenced by registerParams().

Here is the call graph for this function:

bool container::serverconfig::AppContext::setDefaultMimeType ( const ConfigNode val  )  [protected]

Definition at line 156 of file appcontext.cpp.

References m_mime, and container::serverconfig::Context::setString().

Referenced by registerParams().

Here is the call graph for this function:

bool container::serverconfig::AppContext::setPhysBase ( const ConfigNode val  )  [protected]

Definition at line 146 of file appcontext.cpp.

References m_physbase, and container::serverconfig::Context::setString().

Referenced by registerParams().

Here is the call graph for this function:

bool container::serverconfig::AppContext::setSessionTimeout ( const ConfigNode val  )  [protected]

Definition at line 129 of file appcontext.cpp.

References container::serverconfig::ConfigNode::getAttrs(), and m_sessionTimeout.

Referenced by registerParams().

Here is the call graph for this function:

bool container::serverconfig::AppContext::setUploadDir ( const ConfigNode val  )  [protected]

Definition at line 141 of file appcontext.cpp.

References m_uploadDir, and container::serverconfig::Context::setString().

Referenced by registerParams().

Here is the call graph for this function:

bool container::serverconfig::AppContext::setUriBase ( const ConfigNode val  )  [protected]

Definition at line 151 of file appcontext.cpp.

References m_uribase, and container::serverconfig::Context::setString().

Referenced by registerParams().

Here is the call graph for this function:

void container::serverconfig::AppContext::splitServPath ( const std::string &  path,
std::string &  dir,
std::string &  name 
) [static, private]

Definition at line 263 of file appcontext.cpp.

void container::serverconfig::AppContext::unloadServlet ( const std::string &  name  )  [private]

Parameters:
name Name of servlet to unload, as specified in name= parameter in config file Stops servlet - that is removed it from mapper, and waits till all requests within this servlet are done.

Definition at line 293 of file appcontext.cpp.

References container::ServletContainer::getConfig(), getDesc(), getServletContainer(), and container::serverconfig::AppContext::AppContext::ServletDesc::m_h.

Referenced by addServlet(), and ~AppContext().

Here is the call graph for this function:


Member Data Documentation

Definition at line 152 of file appcontext.h.

Referenced by addServlet(), and AppContext().

Definition at line 51 of file appcontext.h.

Referenced by getContext().

Definition at line 151 of file appcontext.h.

Referenced by addServlet(), onPreComplete(), and setDefaultCharacterEncoding().

Definition at line 130 of file appcontext.h.

Referenced by getFileSaveTemplate(), and onPostComplete().

Definition at line 150 of file appcontext.h.

Referenced by addServlet(), onPreComplete(), and setDefaultMimeType().

Definition at line 52 of file appcontext.h.

Referenced by AppContext(), and onSetParam().

Base physical path for this application It should roughly correspond to the place where static content for the application is located (e.g. $HOME/public_html) By default it's directory where engine.xml is located (completely random, and in most cases inappropriate default)

Definition at line 149 of file appcontext.h.

Referenced by getRealPath(), and setPhysBase().

Definition at line 129 of file appcontext.h.

Referenced by getSessionCookieName(), and onPreComplete().

Definition at line 131 of file appcontext.h.

Referenced by cleanSessions(), getSession(), and killAllSessions().

Definition at line 54 of file appcontext.h.

Referenced by onPostComplete(), and setUploadDir().

Base virtual path for this application It should roughly correspond to location from which static content for this application is served (e.g. /~user/) It _MUST_ end with '/'

Definition at line 141 of file appcontext.h.

Referenced by getUriBase(), onPreComplete(), and setUriBase().


The documentation for this class was generated from the following files:

SourceForge.net Logo