| setAttribute() | ใช้สร้าง Attribute โดยมีการกำหนด ชื่อ, ค่าข้อมูล และขอบเขตด้วย |
|---|---|
| getAttribute() | ใช้คืนค่า ค่าข้อมูล ของ Attribute ตามชื่อและขอบเขตที่กำหนด |
| getAttributeNamesInScope() | ใช้คืนค่า ชื่อของ Attribute ทั้งหมด ตามขอบเขตที่กำหนด |
| removeAttribute() | ใช้ลบ Attribute ออก ตาม ชื่อและขอบเขตที่กำหนด |
| findAttribute() | ใช้ค้นหา ชื่อของ Attribute ตามที่กำหนด |
| release() | ใช้ทำลาย ค่าต่างๆที่ตั้งไว้ใน pageContext ออกทั้งหมด |
method:setAttribute ( object_string_name, object_string_attribute, int_scope );
return type:void
special:static
content:ใช้สร้าง Attribute โดยมีการกำหนด ชื่อ, ค่าข้อมูล และขอบเขตด้วย โดยขอบเขตมีค่าที่เป็นไปได้คือ page(1), request(2), session(3), application(4)
example:pageContext.setAttribute ( “title”, “ยินดีต้อนรับ”, 2 );
method:getAttribute ( object_string_name, int_scope );
return type:Object
special:static
content:ใช้คืนค่า ค่าข้อมูล ของ Attribute ตามชื่อและขอบเขตที่กำหนด
example:pageContext.setAttribute ( “title”, “ยินดีต้อนรับ”, 2 ); String title = ( String ) pageContext.getAttribute ( “title”, 2 );
method:getAttributeNamesInScope ( int_scope );
return type:Enumeration
special:static
content:ใช้คืนค่า ชื่อของ Attribute ทั้งหมด ตามขอบเขตที่กำหนด
example:pageContext.setAttribute ( “title”, “ยินดีต้อนรับ”, 2 ); pageContext.setAttribute ( “panda”, “แพนด้า”, 2 ); Enumeration enum_attribute = pageContext.getAttributeNamesInScope ( 2 );
method:removeAttribute ( object_string_name, int_scope );
return type:void
special:static
content:ใช้ลบ Attribute ออก ตาม ชื่อและขอบเขตที่กำหนด
example:pageContext.setAttribute ( “title”, “ยินดีต้อนรับ”, 2 ); pageContext.removeAttribute ( “title”, 2 );
method:findAttribute ( object_string_name );
return type:Object
special:static
content:ใช้ค้นหา ชื่อของ Attribute ตามที่กำหนด ถ้าหากพบจะคืนค่า ค่าข้อมูลของ Attribute นั้นๆ ถ้าไม่พบจะคืนค่า null
example:pageContext.setAttribute ( “title”, “ยินดีต้อนรับ”, 2 ); Object obj = pageContext.findAttribute ( “title” );
method:release ();
return type:void
special:static
content:ใช้ทำลาย ค่าต่างๆที่ตั้งไว้ใน pageContext ออกทั้งหมด
example:pageContext.setAttribute ( “title”, “ยินดีต้อนรับ”, 2 ); pageContext.setAttribute ( “panda”, “แพนด้า”, 2 ); pageContext.release ();