String sql = (String)session.getAttribute("sql");

解决方案 »

  1.   

    String sql = (String)session.getAttribute("sql");getAttribute
    public java.lang.Object getAttribute(java.lang.String name)
    Returns the object bound with the specified name in this session, or null if no object is bound under the name.
    Parameters:
    name - a string specifying the name of the object
    Returns:
    the object with the specified name
    Throws:
    IllegalStateException - if this method is called on an invalidated session
      

  2.   

    必须造型的,(String)session.getAttribute("sql");