• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Attribute does not exist when you invoke tag(pg 509 HFSJ)

Vijay Bharghav bheemineni
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

JSP Tag Invocation

<myTags: Simple3>
Message is : ${message}
<myTags: Simlpe3>

Tag Handler

public void doTag() throws JspException,IOException
getJspContext().setAttribute("message","wear sunscreen.");

My doubt is we will be writing the tag handler first and then we will be invoking the tag,then how can we set an attribute "message" because at this point we don't know which attribute(in this case ${message} will be used in the tag invocation .

If I am correct does this mean that container will be adding the line
"getJspContext().setAttribute("message","wear sunscreen.");"

Could any one please explain this?
Sorry if my questions sounds silly but I am new to JSTL & JSP's.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic