• 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

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

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

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?

Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!