• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP Custom Tags & Request Parameter

 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a customized jsp tag which has some attributes i want such a way that i donot want to pass the attribute values when i call these tags but this attributes must be intialized from the request parameters ie request.getParameter() values.
This the mechanism which we see in <jsp:useBean .... tag where the parameter value will be *
Can i make such a setting just in an tld file
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This isn't necessary. From inside your TagLib, you have access to all the implicate objects on the page by using pageContext an implicate object availe to your taglib.
You can get the request object (And subsuqently the request parameters) by
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();

You can also
getSession()
getServletConfig()
getServletContext()
getOut()
getException()

------------------
Hope This Helps
Carl Trusiak, SCJP2
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!