Java Doc for WebManServletContext.java in  » Content-Management-System » webman » de » webman » template » jsp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » webman » de.webman.template.jsp 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   de.webman.template.jsp.WebManServletContext

WebManServletContext
public class WebManServletContext implements ServletContext(Code)
Defines a set of methods that a servlet uses to communicate with a servlet engine, for example, to get the MIME type of a file, locate other servlets running on the server, or write to a servlet log file.

The servlet engine talks to the servlet by returning a ServletContext object (defined by this interface) that gives servlets information about their environment. Servlets use the ServletConfig.getServletContext method to get the ServletContext object.

If the server supports multiple or virtual hosts, the ServletContext object must be at least as unique as the host. Servlet engines can also create ServletContext objects that are unique to a group of servlets and are tied to a specific part of the host's URL namespace. You can assign this grouping administratively or define it in a deployment descriptor file.

The ServletContext object is contained within the ServletConfig object, which the Web server provides the servlet when the servlet is initialized. You can access the ServletConfig object by using the Servlet.getServletConfig method.
author:
   Various
version:
   $Version$
See Also:   Servlet.getServletConfig
See Also:   ServletConfig.getServletContext





Method Summary
public  ObjectgetAttribute(String name)
     Returns the servlet engine attribute with the given name, or null if there is none.
public  EnumerationgetAttributeNames()
     Returns an Enumeration containing the attribute names available within this servlet context.
public  ServletContextgetContext(String uripath)
     Returns a ServletContext object that corresponds to a specified URL on the server.
public  StringgetInitParameter(String param)
    
public  java.util.EnumerationgetInitParameterNames()
    
public  intgetMajorVersion()
     Returns the major version of the Java Servlet API that this Web server supports.
public  StringgetMimeType(String file)
     Returns the MIME type of the specified file, or null if the MIME type is not known.
public  intgetMinorVersion()
     Returns the minor version of the Servlet API that this Web server supports.
public  RequestDispatchergetNamedDispatcher(String name)
    
public  StringgetRealPath(String path)
     Returns a String containing the real path that corresponds to a virtual path.
public  RequestDispatchergetRequestDispatcher(String urlpath)
     Returns a RequestDispatcher object that acts as a wrapper for the resource located at the named path.
public  URLgetResource(String path)
     Returns the resource that is mapped to a specified path.
public  InputStreamgetResourceAsStream(String path)
     Returns the resource located at the named path as an InputStream object.

The data in the InputStream can be of any type or length.

public  java.util.SetgetResourcePaths(java.lang.String path)
     2.3 Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path matches the supplied path argument.
public  StringgetServerInfo()
     Returns the name and version of the servlet engine on which the servlet is running.
public  ServletgetServlet(String name)
    
public  java.lang.StringgetServletContextName()
     2.3 Returns the name of this web application correponding to this ServletContext as specified in the deployment descriptor for this web application by the display-name element.
public  EnumerationgetServletNames()
    
public  EnumerationgetServlets()
    
public  voidlog(String msg)
     Writes the specified message to a servlet log file, which is usually an event log.
public  voidlog(Exception exception, String msg)
    
public  voidlog(String message, Throwable throwable)
     Writes the stack trace and an explanatory message for a given Throwable exception to the servlet log file.
public  voidremoveAttribute(String name)
     Removes the attribute with the given name from the servlet context.
public  voidsetAttribute(String name, Object object)
     Gives an attribute a name in this servlet context.
public  voidsetDocRoot(String root)
    



Method Detail
getAttribute
public Object getAttribute(String name)(Code)
Returns the servlet engine attribute with the given name, or null if there is none. An attribute allows a servlet engine to give the servlet additional information not already provided by this interface. See your Web server documentation for information about its attributes.

The attribute is returned as a java.lang.Object. 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 an Objectnullif no attribute exists matching the givenname




getAttributeNames
public Enumeration getAttributeNames()(Code)
Returns an Enumeration containing the attribute names available within this servlet context. You can use the WebManServletContext.getAttribute method with an attribute name to get the value of an attribute. an Enumeration of attribute names
See Also:   WebManServletContext.getAttribute



getContext
public ServletContext getContext(String uripath)(Code)
Returns a ServletContext object that corresponds to a specified URL on the server.

This method allows servlets to gain access to the resources located at a specified URL and obtain RequestDispatcher objects from it.

In security conscious environments, the servlet engine can return null for a given URL.
Parameters:
  uripath - a String specifying the URL for which you are requesting a ServletContextobject the ServletContext object thatcorresponds to the named URL
See Also:   RequestDispatcher




getInitParameter
public String getInitParameter(String param)(Code)



getInitParameterNames
public java.util.Enumeration getInitParameterNames()(Code)



getMajorVersion
public int getMajorVersion()(Code)
Returns the major version of the Java Servlet API that this Web server supports. All implementations that comply with Version 2.1 must have this method return the integer 2. 2



getMimeType
public String getMimeType(String file)(Code)
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 engine. Common MIME types are "text/html" and "image/gif".
Parameters:
  a - String specifying the nameof the file whose MIME type you wantto check a String specifying the MIME type



getMinorVersion
public int getMinorVersion()(Code)
Returns the minor version of the Servlet API that this Web server supports. All implementations that comply with Version 2.1 must have this method return the integer 1. 1



getNamedDispatcher
public RequestDispatcher getNamedDispatcher(String name)(Code)



getRealPath
public String getRealPath(String path)(Code)
Returns a String containing the real path that corresponds to a virtual path. A virtual path contains a servlet name followed by the name of a file the servlet should act upon, in the form /dir/dir/servlet/file.ext. In this form, file.ext is a filename used instead of the path to the file. The servlet locates the file and translates the file name to the path that locates the file.

The real path the servlet returns is in a form appropriate to the computer and operating system on which the servlet engine is running, including the proper path separators. This method returns null if the servlet engine cannot translate the virtual path to a real path for any reason.
Parameters:
  path - a String specifying a virtual path,in the form /dir/dir/servlet/file.ext a String specifying the real path,with path separators appropriate for the systemon which the servlet engine is running




getRequestDispatcher
public RequestDispatcher getRequestDispatcher(String urlpath)(Code)
Returns a RequestDispatcher object that acts as a wrapper for the resource located at the named path. You can use a RequestDispatcher object to forward a request to the resource or include a resource in a response.

The pathname must be in the form /dir/dir/file.ext. This method returns null if the ServletContext cannot return a RequestDispatcher.

The servlet engine is responsible for wrapping the resource with a RequestDispatcher object.
Parameters:
  urlpath - a String specifying the pathnameto the resource a RequestDispatcher objectthat acts as a wrapper for the resourceat the path you specify
See Also:   RequestDispatcher




getResource
public URL getResource(String path) throws MalformedURLException(Code)
Returns the resource that is mapped to a specified path. The path must be in the form /dir/dir/file.ext.

This method allows the Web server to make a resource available to a servlet from any source. Resources can be located on a local or remote file system, in a database, or on a remote network site.

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

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

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 specifyingthe path to the resource,in the form /dir/dir/file.ext the resource located at the named path,or null if there is no resourceat that path
exception:
  MalformedURLException - if the pathname is not given in the correct form




getResourceAsStream
public InputStream getResourceAsStream(String path)(Code)
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 of the form /dir/dir/file.ext. This method returns null if no resource exists at the specified path.

Metainformation such as content length and content type that is available when you use the getResource method is lost when you use this method.

The servlet engine 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 engines to make a resource available to a servlet from any location, without using a class loader.
Parameters:
  name - a String specifying the pathto the resource,in the form /dir/dir/file.ext the InputStream returned to the servlet, or null if no resourceexists at the specified path




getResourcePaths
public java.util.Set getResourcePaths(java.lang.String path)(Code)
2.3 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 '/'.



getServerInfo
public String getServerInfo()(Code)
Returns the name and version of the servlet engine on which the servlet is running.

The form of the returned string is servername/versionnumber. For example, the Java Web Server can return the string Java Web Server/1.1.3.

You can design the servlet engine to have this method return other optional information in parentheses after the primary string, for example, Java Web Server/1.1.3 (JDK 1.1.6; Windows NT 4.0 x86). a String containing at least the servlet engine name and version number




getServlet
public Servlet getServlet(String name) throws ServletException(Code)



getServletContextName
public java.lang.String getServletContextName()(Code)
2.3 Returns the name of this web application correponding to this ServletContext as specified in the deployment descriptor for this web application by the display-name element.



getServletNames
public Enumeration getServletNames()(Code)



getServlets
public Enumeration getServlets()(Code)



log
public void log(String msg)(Code)
Writes the specified message to a servlet log file, which is usually an event log. The message provides explanatory information about an exception or error or an action the servlet engine takes. The name and type of the servlet log file is specific to the servlet engine.
Parameters:
  msg - a String specifying the explanatorymessage to be written to the log file



log
public void log(Exception exception, String msg)(Code)
log(String message, Throwable throwable)



log
public void log(String message, Throwable throwable)(Code)
Writes the stack trace and an explanatory message for a given Throwable exception to the servlet log file. The stack trace is part of the Throwable object, and the message is the one you specify in the message parameter. The name and type of the servlet log file is specific to the servlet engine, but it is usually an event log.
Parameters:
  message - a String that describes the error or exception
Parameters:
  throwable - the Throwable error or exception



removeAttribute
public void removeAttribute(String name)(Code)
Removes the attribute with the given name from the servlet context. If you remove an attribute, and then use WebManServletContext.getAttribute to retrieve the attribute's value, getAttribute returns null.
Parameters:
  name - a String specifying the name of the attribute to be removed



setAttribute
public void setAttribute(String name, Object object)(Code)
Gives an attribute a name in this servlet context. If the name specified is already used for an attribute, this method will overwrite the old attribute and bind the name to the new attribute.

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
Parameters:
  object - an Object representing theattribute to be given the name




setDocRoot
public void setDocRoot(String root)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.