Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP markup reuse and request parameters

 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm pretty new to JSPs.
I've some JSP markup, which makes use of attributes in the HttpServletRequest, that I'd like to repeat accross multiple JSPs.
I just started looking into creating a custom tag library, but I don't see a way to get HttpServletRequest attributes from the doStartTag method. Can this be done? Or is there some other way to pass values from the JSP that uses the custom tag to the associated TagSupport methods?
[ July 11, 2003: Message edited by: Dirk Schreckmann ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64711
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Within the tag you can access the request from the pageContext object: pageContext.getRequest().
It returns a ServletRequest so you'll need to cast it to an HttpServletRequest.
hth,
bear
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was a thinkin' about lookin' harder at that pageContext thingy.
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic