Hey there,

I ve a problem with the scopes of attributes in pagecontext

I want to save an object in pageContext with scope request - it fails
with all other scopes it works

and wenn i search for an attribute
I got an 'IlleagalArgumentExeption : unidentified Scope'
I'd excepect a null for attribute but not scope error without addressing
a special scope

Has anyone dealt with this strange  things ().


CODE :

    PageContext pc = getPageContext();

        try{
                pc.setAttribute("MyAttribute1", new
Integer(1),PageContext.APPLICATION_SCOPE);
    } catch (java.lang.IllegalStateException ise ) {System.out.println
("1"+ise.toString());}
                try{
                pc.setAttribute("MyAttribute2", new
Integer(2),PageContext.PAGE_SCOPE);
    } catch (java.lang.IllegalStateException ise ) {System.out.println
("2"+ise.toString());}
                try{
                pc.setAttribute("MyAttribute3", new
Integer(3),PageContext.SESSION_SCOPE);
    } catch (java.lang.IllegalStateException ise ) {System.out.println
("3"+ise.toString());}
                try{
                pc.setAttribute("MyAttribute4", new
Integer(4),PageContext.REQUEST_SCOPE);
    } catch (java.lang.IllegalStateException ise ) {System.out.println
("4"+ise.toString());}

        try {
        pc.findAttribute("name")
        } catch (IlleagalArgumentExeption iae) {System.out.println
(iae.toString());}

OUTPUT:
4IllegalStateException
IlleagalArgumentExeption : unidentified Scope

/*************************/
 Thomas Schuchert
 Cyberconsult
 Beratungsgesellschaft f�r Neue Medien mbH
 [EMAIL PROTECTED]
 0049 30 - 39 99 05 46
/*************************/

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to