Class RequestContent

java.lang.Object
org.deltava.util.redirect.RequestContent
All Implemented Interfaces:
Serializable

class RequestContent extends Object implements Serializable
A bean to store Servlet Request state when redirecting a command. This allows Web Site Commands to save data in the servlet request for display on a result JSP, while at the same time using a redirect so that refreshing the result URL does not invoke the command a second time.
Since:
1.0
Version:
2.6
Author:
Luke
See Also:
  • Constructor Details

    • RequestContent

      RequestContent(String url)
      Generates a new bean from the current servlet request, and stores the URL to redirect to.
      Parameters:
      url - the URL to forward to
      See Also:
  • Method Details

    • getAttributeNames

      public Set<String> getAttributeNames()
      Returns the saved servlet request attribute names.
      Returns:
      a Set of attribute names
    • getAttributeValues

      public Collection<Object> getAttributeValues()
      Returns the saved servlet request attribute values.
      Returns:
      a Collection of objects
    • getAttribute

      public Object getAttribute(String attrName)
      Returns a saved servlet request attribute.
      Parameters:
      attrName - the attribute name
      Returns:
      the attribute value, or null if not found
    • getURL

      public String getURL()
      Returns the URL to redirect to. The RedirectCommand will forward to this URL once it has restored the servlet request attributes.
      Returns:
      the URL to forward to
    • setAttribute

      public void setAttribute(String attrName, Object value)
      Adds a saved servlet request attribute.
      Parameters:
      attrName - the attribut name
      value - the attribute value
    • size

      public int size()
      Returns the number of saved servlet request attributes.
      Returns:
      the number of saved attributes