File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:getproperty

 
giuseppe russo
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 9145
75
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please QuoteYourSources
 
R. Jain
Ranch Hand
Posts: 375
1
Java Python Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic