Creating images(buttons) on the fly via jsp/servlet

Hello,
I have a menu on a page that is generated dynamically. Since some of the menu items are user created  i have always had to use regular text. I would like to use images, but i would have to create it on the fly. I have seen some perl libs that allow you to do this.. Has anyone seem or created something where you can create image menu buttons on the fly using jsp's/servlets?

I hope this question makes sense

Randy
pariesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TimYatesCommented:
Getting a servlet to generate a JPG is really quite simple :-)

The process goes:

1) Create your BufferedImage
2) Draw on it (text, etc)
3) stream it back out as a JPG

then you can do:

<img src="myServlet?text=Hi">

for example :-)

Hang on, I'll find you an example off the web :-)

Tim
0
TimYatesCommented:
http://www.javaworld.com/javaworld/jw-05-2000/jw-0505-servlets-p2.html

Does something like this :-)

And comes with source code :-)

Good luck!!

Tim
0
TimYatesCommented:
http://today.java.net/pub/a/today/2004/04/22/images.html

is a cool (and more recent and simpler) example too :-)
0
TimYatesCommented:
With that last example, the code you want to have a look at is here:

http://today.java.net/today/2004/04/22/images.tar.gz

inside

serverimages/src/jsp

there is text.jsp

So that shows you how to generate images using a JSP rather than a servlet (and the ImageIO method for writing the image out is much neater) :-)

Tim
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TimYatesCommented:
Good luck with it :-)

Tim
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.