aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes jsp:getproperty Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "jsp:getproperty" Watch "jsp:getproperty" New topic
Author

jsp:getproperty

giuseppe russo
Greenhorn

Joined: Aug 16, 2012
Posts: 1
Hi!
I've a problem with a question about jsp:getproperty:


Given the JavaBean class:
public class MyBean {
private Boolean roasted = false;
public MyBean () {}
public Boolean isRoasted () { returned roasted }
public void setRoasted (Boolean roasted) { this.roasted = roasted; ]
}
Assume a controller has created an instance of this bean, called setRoasted (true), and
inserted the bean into the application scope using the name 'myBean'.
A JSP contains these two tags:
<jsp: useBean id = 'aBean' class = 'MyBean' scope = 'page' \ />
<jsp: getProprty name = 'aBean' property = 'roasted' \ />
Which is true?
A. the page will include the output false
B. the page will include the output
C. the page will report that the property roasted does not exist
D. the page will report that the syntax of the useBean tag is incorrect
E. the page will report that the syntax of the getProperty tag ls incorrect


The book says E, but I cannot understand why. I thought the right answer was A.
Could someone help me please?

Thank you
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5597
    
  15

Please QuoteYourSources


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
R. Jain
Ranch Hand

Joined: Aug 11, 2012
Posts: 375
    
    1

giuseppe russo wrote:Hi!
I've a problem with a question about jsp:getproperty:


A JSP contains these two tags:
<jsp: useBean id = 'aBean' class = 'MyBean' scope = 'page' \ />
<jsp: getProprty name = 'aBean' property = 'roasted' \ />
Which is true?
A. the page will include the output false
B. the page will include the output
C. the page will report that the property roasted does not exist
D. the page will report that the syntax of the useBean tag is incorrect
E. the page will report that the syntax of the getProperty tag ls incorrect


The book says E, but I cannot understand why. I thought the right answer was A.
Could someone help me please?

Thank you


Notice that useBean tag is closed at the place where it started... It should close after the getProperty tag...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp:getproperty