aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes scope attribute (HFSJ) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "scope attribute (HFSJ)" Watch "scope attribute (HFSJ)" New topic
Author

scope attribute (HFSJ)

sangeeta kapoor
Ranch Hand

Joined: Jun 15, 2004
Posts: 70
Page 355 HFSJ



If you don't specify scope in either the <jsp:useBean> or <jsp:getProperty> tags, the container uses the default of "page"


I have only used scope in <jsp:useBean>.
Can scope be specified in <jsp:getProperty> , if yes when is it used ?
Rodrigo W Bonatto
Ranch Hand

Joined: Aug 20, 2004
Posts: 62
Hi,

<jsp:getProperty> tag doesn't have the scope attribute.
I think you can specify the scope only in the <jsp:usebean> tag.

Rodrigo


SCJA, SCJP, SCJD, SCWCD, SCBCD5, SCDJWS, SCEA5
Ritu varada
Ranch Hand

Joined: Sep 08, 2004
Posts: 117
Rodrigo is right. The below is the JSP 2.0 specification

Syntax
<jsp:getProperty name=�name� property=�propertyName� />
The attributes are:

jsp:getProperty Attributes

name The name of the object instance from which the property is
obtained.
property Names the property to get.

whereas jsp:useBean has scope

This action may or not have a body. If the action has no body, it is of the form:
<jsp:useBean id="name" scope="page|request|session|application" typeSpec />
typeSpec ::= class=�className� |
class=�className� type=�typeName� |
type=�typeName� class=�className� |
beanName=�beanName� type=�typeName� |
type=�typeName� beanName=�beanName� |
type=�typeName�


Hope this helps.


SCJP,SCWCD(1.4)
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hello,

The <jsp:getProperty> doesn't have a scope attribute. The value of the attribute will refer to an object that is obtained from pageContext object through its findAttribute method.

That means it searches the named attribute in page, request, session (if valid), and application scopes in order and return the value.

Thanks


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: scope attribute (HFSJ)
 
Similar Threads
jsp:setProperty / getProprty
jsp:useBean
Scope Attribute for jsp:set and jsp:get
doubt on jsp:useBean tag
jsp:useBean standard action doubt