File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes useBean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "useBean" Watch "useBean" New topic


amarkirt saroay
Ranch Hand

Joined: Mar 16, 2008
Posts: 167
If we have request.setAttribute("emp",e);

and In <jsp:useBean id="emp" scope="request" class="com.example.Employee" >
which of the following are correct to have ?
<jsp:setProperty name="emp" property="name" value="kt"/>
or <jsp:setProperty name="e" property="name" value="kt"/>

Which one is correct value for name attribute of setProperty and same way for getProperty also?

<jsp:getProperty name="emp" property="name"/>

or <jsp:getProperty name="e" property="name"/>

Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

The name of the getProperty/setProperty must match the id of the bean. In your case, the id is "emp".
You can check this kind of thing in the JSP specification.

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: useBean
It's not a secret anymore!