javax.servlet.jsp

Class JspContext

Known Direct Subclasses:
MockJspContext, PageContext

public abstract class JspContext
extends Object

Method Summary

abstract Object
findAttribute(String name)
Finds an attribute in all scopes.
abstract Object
getAttribute(String name)
Gets the named page attribute.
abstract Object
getAttribute(String name, int scope)
Gets an attribute in a given scope.
abstract Enumeration<E>
getAttributeNames()
Return an enumeration of all the attribute names.
abstract Enumeration<E>
getAttributeNamesInScope(int scope)
Lists attribute names in a given scope.
abstract int
getAttributesScope(String name)
Returns the scope for an attribute.
abstract ELContext
getELContext()
Returns the EL context with the JspContext
abstract ExpressionEvaluator
getExpressionEvaluator()
Returns an expression evaluator for creating JSP EL expressions.
abstract JspWriter
getOut()
Returns the current output for the page.
abstract VariableResolver
getVariableResolver()
Returns a variable resolver for evaluating JSP EL expressions.
JspWriter
popBody()
Internal routine to support BodyTags.
JspWriter
pushBody(Writer writer)
Internal routine to support BodyTags.
abstract void
removeAttribute(String name)
Removes the named page attribute.
abstract void
removeAttribute(String name, int scope)
Removes an attribute in a given scope.
abstract void
setAttribute(String name, Object attribute)
Sets the named page attribute.
abstract void
setAttribute(String name, Object o, int scope)
Sets an attribute in a given scope.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Details

findAttribute

public abstract Object findAttribute(String name)
Finds an attribute in all scopes.

getAttribute

public abstract Object getAttribute(String name)
Gets the named page attribute.
Parameters:
name - of the attribute
Usages and Demos :

View More Examples of getAttribute(String name)
   1: 
   2: import javax.servlet.jsp.JspContext;
   3: import javax.servlet.jsp.PageContext;
   4:         ...
   5:     protected int discriminator;
   6:     protected JspContext jspContext;
   7:     protected PageContext pageContext;
   8:         ...
   9:             String key = (String)keys.next();
  10:             originalValues.put( key, jspContext.getAttribute( key ) );
  11:             Object newValue = params.get( key );

View Full Code Here
   1: 
   2:     out.println("javax.servlet.jsp.JspContext _jsp_parentContext = getJspContext();");
   3:     out.println("com.caucho.jsp.PageContextWrapper pageContext = com.caucho.jsp.PageContextWrapper.create(_jsp_parentContext);");
   4:         ...
   5:     
   6:     out.println("com.caucho.jsp.PageContextWrapper jspContext = pageContext;");
   7:     out.println("javax.el.ELContext _jsp_env = pageContext.getELContext();");
   8:         ...
   9:     out.println();
  10:     out.println("public static void doTag(javax.servlet.jsp.JspContext _jsp_parentContext,");
  11:     out.println("                         com.caucho.jsp.PageContextWrapper pageContext,");
  12:         ...
  13:     out.print("Object _jsp_nested_var_" + i + " = ");
  14:     out.println("_jsp_parentContext.getAttribute(" + dstName + ");");

View Full Code Here

getAttribute

public abstract Object getAttribute(String name,
                                    int scope)
Gets an attribute in a given scope. You should use the scope-specific routines instead, like request.getAttribute.
Parameters:
name - attribute name
scope - attribute scope

getAttributeNames

public abstract Enumeration<E> getAttributeNames()
Return an enumeration of all the attribute names.

getAttributeNamesInScope

public abstract Enumeration<E> getAttributeNamesInScope(int scope)
Lists attribute names in a given scope. You should use the scope-specific routines instead, like request.getAttributeNames

getAttributesScope

public abstract int getAttributesScope(String name)
Returns the scope for an attribute.

getELContext

public abstract ELContext getELContext()
Returns the EL context with the JspContext

getExpressionEvaluator

public abstract ExpressionEvaluator getExpressionEvaluator()
Returns an expression evaluator for creating JSP EL expressions.

getOut

public abstract JspWriter getOut()
Returns the current output for the page.
Usages and Demos :

View More Examples of getOut()
   1: 
   2: import javax.servlet.jsp.JspContext;
   3: import javax.servlet.jsp.JspWriter;
   4:         ...
   5: 
   6:     private JspContext _jspC;
   7: 
   8:         ...
   9: 
  10:     public WriteRenderAppender(JspContext jspC)
  11:     {
  12:         ...
  13:     {
  14:         JspWriter writer = _jspC.getOut();

View Full Code Here
   1: import javax.servlet.jsp.ErrorData;
   2: import javax.servlet.jsp.JspContext;
   3: import javax.servlet.jsp.JspWriter;
   4:         ...
   5: 
   6:   public static PageContextWrapper create(JspContext parent)
   7:   {
   8:         ...
   9:     clearAttributes();
  10:     setOut(parent.getOut());
  11:     _isFilled = true;
  12:         ...
  13:   {
  14:     return _parent.getOut();

View Full Code Here
   1: import javax.servlet.http.HttpServletRequest;
   2: import javax.servlet.jsp.JspContext;
   3: import javax.servlet.jsp.JspException;
   4:         ...
   5:     {
   6:         JspContext ctxt = getJspContext();
   7:         if (ctxt instanceof PageContext)
   8:         ...
   9: 
  10:         assert(false) : "The JspContext was not a PageContext";
  11:         logger.error("The JspContext was not a PageContext");
  12:         ...
  13:         JspContext ctxt = getJspContext();
  14:         JspWriter writer = ctxt.getOut();

View Full Code Here
   1: import javax.servlet.jsp.JspException;
   2: import javax.servlet.jsp.JspContext;
   3: import javax.servlet.jsp.tagext.JspFragment;
   4:         ...
   5:         throws JspException {
   6:         JspContext jspContext = getJspContext();
   7:         DataGridTagModel dataGridModel = DataGridUtil.getDataGridTagModel(jspContext);
   8:         ...
   9: 
  10:         jspContext.getOut().write(content.toString());

View Full Code Here
   1: import javax.servlet.jsp.JspException;
   2: import javax.servlet.jsp.JspContext;
   3: import javax.servlet.http.HttpServletRequest;
   4:         ...
   5: 
   6:         JspContext jspContext = getJspContext();
   7:         DataGridTagModel dgm = DataGridUtil.getDataGridTagModel(jspContext);
   8:         ...
   9: 
  10:             jspContext.getOut().write(content.toString());
  11:         }

View Full Code Here

getVariableResolver

public abstract VariableResolver getVariableResolver()
Returns a variable resolver for evaluating JSP EL expressions.
Usages and Demos :

View More Examples of getVariableResolver()
   1: 
   2: import javax.servlet.jsp.JspContext;
   3: import javax.servlet.jsp.el.ELException;
   4:         ...
   5: 
   6:     public RootContext(final JspContext ctx) {
   7:         super();
   8:         ...
   9:         } else {
  10:           this.variableResolver = ctx.getVariableResolver();
  11:         }

View Full Code Here

popBody

public JspWriter popBody()
Internal routine to support BodyTags.

pushBody

public JspWriter pushBody(Writer writer)
Internal routine to support BodyTags.

removeAttribute

public abstract void removeAttribute(String name)
Removes the named page attribute.
Usages and Demos :

View More Examples of removeAttribute(String name)
   1: import java.util.Stack;
   2: import javax.servlet.jsp.JspContext;
   3: 
   4:         ...
   5: 
   6:     public static void addDataAccessProvider(IDataAccessProvider provider, JspContext jspContext) {
   7:         assert jspContext != null;
   8:         ...
   9:             else
  10:                 jspContext.removeAttribute("container");

View Full Code Here
   1: 
   2: import javax.servlet.jsp.JspContext;
   3: 
   4:         ...
   5: 
   6:     public static DataGridTagModel getDataGridTagModel(JspContext jspContext) {
   7:         Object model = jspContext.getAttribute(KEY_GRID_MODEL);
   8:         ...
   9:     public static void removeDataGridTagModel(JspContext jspContext) {
  10:         jspContext.removeAttribute(KEY_GRID_MODEL);
  11:     }
  12:         ...
  13:     public static void removeCellModel(JspContext jspContext) {
  14:         jspContext.removeAttribute(KEY_CELL_MODEL);

View Full Code Here
   1: 
   2: import javax.servlet.jsp.JspContext;
   3: import javax.servlet.jsp.PageContext;
   4:         ...
   5:     protected int discriminator;
   6:     protected JspContext jspContext;
   7:     protected PageContext pageContext;
   8:         ...
   9:             else {
  10:                 jspContext.removeAttribute( key );
  11:             }
  12:         ...
  13:             if( value == null ) {
  14:                 jspContext.removeAttribute( key );

View Full Code Here
   1: import javax.servlet.http.HttpServletResponse;
   2: import javax.servlet.jsp.JspContext;
   3: import javax.servlet.jsp.PageContext;
   4:         ...
   5: 
   6:     public static void loadActionForm(JspContext jspContext, Object form) {
   7:         jspContext.setAttribute(ACTION_FORM_IMPLICIT_OBJECT_KEY, unwrapForm(form));
   8:         ...
   9:     public static void unloadActionForm(JspContext jspContext) {
  10:         jspContext.removeAttribute(ACTION_FORM_IMPLICIT_OBJECT_KEY);
  11:     }
  12:         ...
  13:     public static void unloadFacesBackingBean(ServletRequest request) {
  14:         request.removeAttribute(BACKING_IMPLICIT_OBJECT_KEY);

View Full Code Here

removeAttribute

public abstract void removeAttribute(String name,
                                     int scope)
Removes an attribute in a given scope. You should use the scope-specific routines instead, like request.removeAttribute.

setAttribute

public abstract void setAttribute(String name,
                                  Object attribute)
Sets the named page attribute.
Parameters:
name - name of the attribute
attribute - non-null attribute value.
Usages and Demos :

View More Examples of setAttribute(String name,Object attribute)
   1: 
   2: import javax.servlet.jsp.JspContext;
   3: import javax.servlet.jsp.JspException;
   4:         ...
   5:         StringTokenizer tok = new StringTokenizer(formatted,":");
   6:         JspContext context = getJspContext();
   7:         ...
   8:         context.setAttribute("day", tok.nextToken() );
   9:         ...
  10:         context.setAttribute("month", tok.nextToken() );

View Full Code Here
   1: import java.util.Stack;
   2: import javax.servlet.jsp.JspContext;
   3: 
   4:         ...
   5: 
   6:     public static void addDataAccessProvider(IDataAccessProvider provider, JspContext jspContext) {
   7:         assert jspContext != null;
   8:         ...
   9: 
  10:             jspContext.setAttribute(KEY, curStack);
  11:         }
  12:         ...
  13: 
  14:         jspContext.setAttribute("container", bean);

View Full Code Here
   1: 
   2: import javax.servlet.jsp.JspContext;
   3: 
   4:         ...
   5:     private ELEvaluator evaluator;
   6:     private JspContext jspCtx;
   7:     private RootContext rootCtx;
   8:         ...
   9:         jspCtx = new MockJspContext();
  10:         jspCtx.setAttribute("foo", "1");
  11:         rootCtx = new RootContext(jspCtx);

View Full Code Here
   1: 
   2: import javax.servlet.jsp.JspContext;
   3: 
   4:         ...
   5: 
   6:     public static DataGridTagModel getDataGridTagModel(JspContext jspContext) {
   7:         Object model = jspContext.getAttribute(KEY_GRID_MODEL);
   8:         ...
   9:     public static void putDataGridTagModel(JspContext jspContext, DataGridTagModel dataGridTagModel) {
  10:         jspContext.setAttribute(KEY_GRID_MODEL, dataGridTagModel);
  11:     }
  12:         ...
  13:     public static void putCellModel(JspContext jspContext, CellModel cellModel) {
  14:         jspContext.setAttribute(KEY_CELL_MODEL, cellModel);

View Full Code Here
   1: 
   2: import javax.servlet.jsp.JspContext;
   3: import javax.servlet.jsp.PageContext;
   4:         ...
   5:     protected int discriminator;
   6:     protected JspContext jspContext;
   7:     protected PageContext pageContext;
   8:         ...
   9:             if( newValue != null ) {
  10:                 jspContext.setAttribute( key, newValue );
  11:             }
  12:         ...
  13:             else {
  14:                 jspContext.setAttribute( key, value );

View Full Code Here

setAttribute

public abstract void setAttribute(String name,
                                  Object o,
                                  int scope)
Sets an attribute in a given scope. You should use the scope-specific routines instead, like request.setAttribute.
Parameters:
name - attribute name
o - attribute value
scope - attribute scope