About Question enthuware.jwpv6.2.1169 :

Moderator: admin

Post Reply
ETS User

About Question enthuware.jwpv6.2.1169 :

Post 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}' />

Online
admin
Site Admin
Posts: 10386
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.1169 :

Post 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.

vs2013
Posts: 9
Joined: Wed Jul 31, 2013 1:57 pm
Contact:

Re: About Question enthuware.jwpv6.2.1169 :

Post 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests