Skip to main content
0 online

getRealPath in a Tag Handler LOCKED

doonavin by doonavinOG 2003 · Jul 3, 2006 · 93 views · ·

Locked Thread

This thread is locked. New replies are not allowed.

So, I've been transitioning all my developement over to Java since I've been running Linux hard-core for the past 8-months on my personal machines and I want to keep everything multi-platform.

We recently had a good jsp hosting company come on to JSPIN.com with some good capacity and good prices, so I'm transitioning my personal site to jsp, but I have a quick question for some of you guys that have been doing it heavily for a good amount of time.

I'm writing a tag handler to dynamically read in an image, manipulate it, and then either save it or write it directly to the output stream (in my aspx page, I just wrote an httphandler). Not that difficult, and i already got it working from within a jsp, but inside the tag handler I think I am missing how to get the ServletContext in order to access the getRealPath method to read the files.

Any ideas?

4 Comments

doonavin doonavinOG 2003 ·

[Moved to Programming]

deanh77 deanh77Founder ·

This should be in the programming forum BTW. we don't get much traffic over there. Help a brother out.

deanh77 deanh77Founder ·

you have access to the pageContext within your tag class IIRC (at least if you extend TagSupport)?

pageContext.getServletContext() should work.

iwz iwz ·

yeah, i think this is what you want to do.

Welcome Back to eZabel

It's been a while. Here's what's new.

eZabel Lore

A complete history of our community — stats, Hall of Fame, legendary threads, and more.

View the Lore →

Everything Preserved

All 225,969 pieces of content from 2000–2014 are here — forums, messages, journals, photos, polls, and events.

💎

Gems

Spot something you love — a legendary comment, a classic thread, a great photo? Log in and click the diamond icon to mark it as a Gem. Add a note about why it's special. The best stuff surfaces on the Gems page.