• Post Reply Bookmark Topic Watch Topic
  • New Topic

Headfirst Servlets and Jsp <c:set> pg.457

 
Neil Muya
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers, I'm just confused with this line in Headfirst Servlets and Jsp <c:set> pg.457.

It say's here that:

"You can never have both the "var" and "target" attributes in a <c:set>."

But when I try this block of codes it's working fine.

Here is the servlet doGet:


Here is the Jsp:


Hi ranchers hope you could help me!

Thanks!
 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think you can use both together..
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSP specification does not say anything in this case. There are only four syntaxes expected :

If it's not one of these, I guess that it's up to the container to decide what to do.
 
Neil Muya
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Hmmm.. Does this mean that Headfirst Servlets and Jsp Rules regarding <c:set> is with an older version of jstl?

I am wondering on what rules to follow for the exam SCWCD 5..


Quite confused..

But anyway thanks for the reply guys.

 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 2791
181
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Neil,
Hmmm.. Does this mean that Headfirst Servlets and Jsp Rules regarding <c:set> is with an older version of jstl?

No, they are correct: don't use both of them at the same time (although you can)
I am wondering on what rules to follow for the exam SCWCD 5..

The exam always follows the official specifications which means one of the four possibilities that Christophe gave you

Regards,
Frits
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!