Page 1 of 1

About Question enthuware.jwpv6.2.1169 :

Posted: Thu Jan 03, 2013 7:49 am
by ETS User
explanation says :
To pass the Student object, you should write:

<mytaglib:studentTag student='<%=student%>' />


but whatever is in the jsp expression goes to out.println(). so <%=student%> will evaluate to whatever the toString method of Student class returns . right ? shouldnt we have used
<mytaglib:studentTag student='${student}' />

Re: About Question enthuware.jwpv6.2.1169 :

Posted: Thu Jan 03, 2013 2:11 pm
by admin
As per Section JSP.1.14.1 (Request Time Attribute Values):
An attribute value of the form “<%= scriptlet_expr %>” or
‘<%= scriptlet_expr %>’ denotes a request-time attribute value. The value denoted is that of the scriptlet expression involved.

student='${student}' is valid as well if EL is activated.

HTH,
Paul.

Re: About Question enthuware.jwpv6.2.1169 :

Posted: Wed Jul 31, 2013 2:02 pm
by vs2013
Hi,

I actually picked "None of these" because I thought that there is a name conflict between bean name "student" and attribute name "student" in the mytaglib. So, is it OK to have same names for a bean name and attribute?

Thanks,
Victor.