Java Doc for JspContext.java in  » 6.0-JDK-Core » Servlet-API-by-tomcat » javax » servlet » jsp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
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
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » Servlet API by tomcat » javax.servlet.jsp 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.servlet.jsp.JspContext

All known Subclasses:   javax.servlet.jsp.PageContext,
JspContext
abstract public class JspContext (Code)

JspContext serves as the base class for the PageContext class and abstracts all information that is not specific to servlets. This allows for Simple Tag Extensions to be used outside of the context of a request/response Servlet.

The JspContext provides a number of facilities to the page/component author and page implementor, including:

  • a single API to manage the various scoped namespaces
  • a mechanism to obtain the JspWriter for output
  • a mechanism to expose page directive attributes to the scripting environment

Methods Intended for Container Generated Code

The following methods enable the management of nested JspWriter streams to implement Tag Extensions: pushBody() and popBody()

Methods Intended for JSP authors

Some methods provide uniform access to the diverse objects representing scopes. The implementation must use the underlying machinery corresponding to that scope, so information can be passed back and forth between the underlying environment (e.g. Servlets) and JSP pages. The methods are: setAttribute(), getAttribute(), findAttribute(), removeAttribute(), getAttributesScope() and getAttributeNamesInScope().

The following methods provide convenient access to implicit objects: getOut()

The following methods provide programmatic access to the Expression Language evaluator: getExpressionEvaluator(), getVariableResolver()
since:
   2.0




Constructor Summary
public  JspContext()
     Sole constructor.

Method Summary
abstract public  ObjectfindAttribute(String name)
     Searches for the named attribute in page, request, session (if valid), and application scope(s) in order and returns the value associated or null.
abstract public  ObjectgetAttribute(String name)
     Returns the object associated with the name in the page scope or null if not found.
abstract public  ObjectgetAttribute(String name, int scope)
     Return the object associated with the name in the specified scope or null if not found.
abstract public  EnumerationgetAttributeNamesInScope(int scope)
     Enumerate all the attributes in a given scope.
abstract public  intgetAttributesScope(String name)
     Get the scope where a given attribute is defined.
abstract public  ExpressionEvaluatorgetExpressionEvaluator()
     Provides programmatic access to the ExpressionEvaluator.
abstract public  JspWritergetOut()
     The current value of the out object (a JspWriter).
abstract public  VariableResolvergetVariableResolver()
     Returns an instance of a VariableResolver that provides access to the implicit objects specified in the JSP specification using this JspContext as the context object.
public  JspWriterpopBody()
     Return the previous JspWriter "out" saved by the matching pushBody(), and update the value of the "out" attribute in the page scope attribute namespace of the JspContext.
public  JspWriterpushBody(java.io.Writer writer)
     Return a new JspWriter object that sends output to the provided Writer.
abstract public  voidremoveAttribute(String name)
     Remove the object reference associated with the given name from all scopes.
abstract public  voidremoveAttribute(String name, int scope)
     Remove the object reference associated with the specified name in the given scope.
abstract public  voidsetAttribute(String name, Object value)
     Register the name and value specified with page scope semantics.
abstract public  voidsetAttribute(String name, Object value, int scope)
     Register the name and value specified with appropriate scope semantics.


Constructor Detail
JspContext
public JspContext()(Code)
Sole constructor. (For invocation by subclass constructors, typically implicit.)




Method Detail
findAttribute
abstract public Object findAttribute(String name)(Code)
Searches for the named attribute in page, request, session (if valid), and application scope(s) in order and returns the value associated or null.
Parameters:
  name - the name of the attribute to search for the value associated or null
throws:
  NullPointerException - if the name is null



getAttribute
abstract public Object getAttribute(String name)(Code)
Returns the object associated with the name in the page scope or null if not found.
Parameters:
  name - the name of the attribute to get the object associated with the name in the page scope or null if not found.
throws:
  NullPointerException - if the name is null



getAttribute
abstract public Object getAttribute(String name, int scope)(Code)
Return the object associated with the name in the specified scope or null if not found.
Parameters:
  name - the name of the attribute to set
Parameters:
  scope - the scope with which to associate the name/object the object associated with the name in the specifiedscope or null if not found.
throws:
  NullPointerException - if the name is null
throws:
  IllegalArgumentException - if the scope is invalid
throws:
  IllegalStateException - if the scope is PageContext.SESSION_SCOPE but the page that was requesteddoes not participate in a session or the session has beeninvalidated.



getAttributeNamesInScope
abstract public Enumeration getAttributeNamesInScope(int scope)(Code)
Enumerate all the attributes in a given scope.
Parameters:
  scope - the scope to enumerate all the attributes for an enumeration of names (java.lang.String) of all the attributes the specified scope
throws:
  IllegalArgumentException - if the scope is invalid
throws:
  IllegalStateException - if the scope is PageContext.SESSION_SCOPE but the page that was requesteddoes not participate in a session or the session has beeninvalidated.



getAttributesScope
abstract public int getAttributesScope(String name)(Code)
Get the scope where a given attribute is defined.
Parameters:
  name - the name of the attribute to return the scope for the scope of the object associated with the name specified or 0
throws:
  NullPointerException - if the name is null



getExpressionEvaluator
abstract public ExpressionEvaluator getExpressionEvaluator()(Code)
Provides programmatic access to the ExpressionEvaluator. The JSP Container must return a valid instance of an ExpressionEvaluator that can parse EL expressions. A valid instance of an ExpressionEvaluator.
since:
   2.0



getOut
abstract public JspWriter getOut()(Code)
The current value of the out object (a JspWriter). the current JspWriter stream being used for client response



getVariableResolver
abstract public VariableResolver getVariableResolver()(Code)
Returns an instance of a VariableResolver that provides access to the implicit objects specified in the JSP specification using this JspContext as the context object. A valid instance of a VariableResolver.
since:
   2.0



popBody
public JspWriter popBody()(Code)
Return the previous JspWriter "out" saved by the matching pushBody(), and update the value of the "out" attribute in the page scope attribute namespace of the JspContext. the saved JspWriter.



pushBody
public JspWriter pushBody(java.io.Writer writer)(Code)
Return a new JspWriter object that sends output to the provided Writer. Saves the current "out" JspWriter, and updates the value of the "out" attribute in the page scope attribute namespace of the JspContext.

The returned JspWriter must implement all methods and behave as though it were unbuffered. More specifically:

  • clear() must throw an IOException
  • clearBuffer() does nothing
  • getBufferSize() always returns 0
  • getRemaining() always returns 0


Parameters:
  writer - The Writer for the returned JspWriter to sendoutput to. a new JspWriter that writes to the given Writer.
since:
   2.0



removeAttribute
abstract public void removeAttribute(String name)(Code)
Remove the object reference associated with the given name from all scopes. Does nothing if there is no such object.
Parameters:
  name - The name of the object to remove.
throws:
  NullPointerException - if the name is null



removeAttribute
abstract public void removeAttribute(String name, int scope)(Code)
Remove the object reference associated with the specified name in the given scope. Does nothing if there is no such object.
Parameters:
  name - The name of the object to remove.
Parameters:
  scope - The scope where to look.
throws:
  IllegalArgumentException - if the scope is invalid
throws:
  IllegalStateException - if the scope is PageContext.SESSION_SCOPE but the page that was requesteddoes not participate in a session or the session has beeninvalidated.
throws:
  NullPointerException - if the name is null



setAttribute
abstract public void setAttribute(String name, Object value)(Code)
Register the name and value specified with page scope semantics. If the value passed in is null, this has the same effect as calling removeAttribute( name, PageContext.PAGE_SCOPE ).
Parameters:
  name - the name of the attribute to set
Parameters:
  value - the value to associate with the name, or null if theattribute is to be removed from the page scope.
throws:
  NullPointerException - if the name is null



setAttribute
abstract public void setAttribute(String name, Object value, int scope)(Code)
Register the name and value specified with appropriate scope semantics. If the value passed in is null, this has the same effect as calling removeAttribute( name, scope ).
Parameters:
  name - the name of the attribute to set
Parameters:
  value - the object to associate with the name, or null ifthe attribute is to be removed from the specified scope.
Parameters:
  scope - the scope with which to associate the name/object
throws:
  NullPointerException - if the name is null
throws:
  IllegalArgumentException - if the scope is invalid
throws:
  IllegalStateException - if the scope is PageContext.SESSION_SCOPE but the page that was requesteddoes not participate in a session or the session has beeninvalidated.



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.