• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamic attributes in custom tags

 
Paul Kemp
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HFSJ says there are no dumb questions but maybe I can prove them wrong ;-)

on page 478

<html>
<body>
<%@ taglib prefix=”mine” uri=”randomThings”%>
Advisor Page

<mine:advice user=”${userName}” />
</body>
</html>

My confusion is really about what merit this code has, ie, passing in the user name as a dynamic value.

The tag handler class has access to the JspContext and therefore the PageContext, so would be able to get hold of attributes, parameters, sessions, etc. Couldn't you just remove this bit of EL from the advice custom tag and get the userName directly using the PageContext in the handler?


 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic