Forums Register Login

Accessing JSP implicit objects from outsite the JSP page itself

+Pie Number of slices to send: Send
Hello there,

I have a quick question..

I know you can access a JSP implicit object inside the JSP page using scriplets...such as



now my question is, can this request object be accessed from somewhere else outsite the JSP page. Specifically, I am developing custom tags (i am new to this but have some fundamentals), ie from inside the doTag() in my TagHandler.java class (which extends SimpleSupport)...from withing that method, i want to access the JSP implicit objects, precisely the request and session ones.

Is this possible? if yes, how? (a code snippet will be helpful)

if impossible, what's the logic behind blocking access to these objects specially from within tag handlers? I mean custom tag handlers do tasks on behalf of custom tags inside the JSP page, so it would be logical for these handlers to have access to these implicit object (this is simply my speculation on the matter)


thanks in advance
+Pie Number of slices to send: Send
You don't need to bother with the JSP implicit objects. Within a tag handler, the tag support classes give you direct access to things like the request and session.
+Pie Number of slices to send: Send
Thanks for the response Bear.

but can you give me an example.

I mean where do i get the reference to these objects from? JspContext or where exactly?


thanks
+Pie Number of slices to send: Send
The clue that trips up most people is the the jspContext is really an implementation of PageContext. Once you have that, you have access to just about everything.
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 938 times.
Similar Threads
Q from Hanu's mock test
JSP implicit objects in Simple Tags
taglib and container
Query on Custom Tags
Custom tags ch8 vs. EL functions ch9
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 20:19:24.