Java Reference
In-Depth Information
The value of the ID field must match the value that was used to store the bean as
a request attribute. The value of the Class field must be the fully qualified name of
the bean's type. The value of the Scope field must be the scope we wish to retrieve
the bean from; valid values include page, request, session, or application. The scope
where the bean is placed affects when and where the bean can be accessed. The
following table summarizes all valid scopes.
Bean is only accessible in the current page, including any JSP page
fragments included in the page.
Bean is only accessible withing a single HTTP request, usually from
the page to be displayed after the request is processed.
Bean is accessible across requests in a single HTTP session, typically
this means there is a single instance of the bean per user of the
Bean is accessible across HTTP sessions, typically this means there is a
single instance of the bean accessible to all users of the application.
After filling out all fields, NetBeans inserts the following markup code in the location
where we dropped the component:
<jsp:useBean id="surveyData" scope="request"
class="com.ensode.nbbook.model.SurveyData" />
The next thing we need to do is replace the JSP expression retrieving the fullName
request parameter with the <jsp:getProperty> tag. This tag retrieves the value of
a JSP property. Again we can either type the tag in the appropriate location, or drag
it from the palette and drop it into the page. As usual, NetBeans pops up a window
when the tag is dropped into the page.
Search WWH ::

Custom Search