Java Reference
In-Depth Information
The scriptlet also assigns the EmpExtractor object to the variable ee.
Finally, the scriptlet invokes the getEmployeeInstance method and sends the request object referenced by the
variable request. Hey, where did the variable request come from? In fact, where did the request object come from?
There was no import statement for the Request class nor was a request object passed from the server to the JSP!
Are you starting to wonder what's going on?
The variable request is another example of the server making your programming life easier. The JSP container
provides what are called JSP implicit objects . Essentially, these are predefined variables and objects that all JSPs can
access. (In addition to the request, there is also a response object and a variable named response that can be used by JSPs.)
Not having to write the Java code to define and pass these variables is one more reason why JSPs are so much easier to
use than servlets.
5.
Change back to the Design view.
6.
Put a space after the first line of text and click JSP , then Insert Expression .
7.
In the Properties view, add the statement as seen in Figure 9-7 .
Figure 9-7.
8.
As done in step 7, add the following expressions in the appropriate cells of the table's
second column:
emp.getEmpName()
emp.getEmpStreet()
emp.getPayRate()
emp.getExemptions()
The Design view should look like Figure 9-8 .
 
Search WWH ::




Custom Search