File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "useBean" Watch "useBean" New topic
Author

useBean

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"/>


SCJP-75%
SCWCD-82%
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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: http://aspose.com/file-tools
 
subject: useBean
 
Similar Threads
useBean standard action
Polymorphism and useBean
jsp:usebean
jsp:setProperty stand action and its body
compilation error coming up