This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes Forward servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark "Forward servlets" Watch "Forward servlets" New topic

Forward servlets

Joe Schaffer

Joined: Mar 24, 2004
Posts: 29
Hi there,

I have a question about forwarding a link to a servlet. My web page generates dynamically HTML code for servlets. My idea is to dynamically generate code to show all pictures in my tree.

I have no problems to figure out the pictures in the tree. I can dynamically generate them as a link.

My problem occurs, when I want to load them in a single window. I don't want to generate one html page for each picture to display. I want to call one servlet and just show this selected picture in it. Therfore I need to forward a value with the link in which I call the servlet. How is this possibile?

Rough: Servlet A has a link of Servlet B. The link in A is dynamic generated and unique. The unique value has to be transmitted to Servlet B. With this information I can then load the picture! How can I forward it?

Best regards and thanks in advance

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12933
How do normal HTML pages create multipl images in a page? Just think about it. Your IMG tag has to use a SRC that points to the servlet that will generate the picture with a parameter that indicates which picture to generate.
Joe Schaffer

Joined: Mar 24, 2004
Posts: 29
thx for the reply! I was standing in the middle of a forest and haven't seen a single tree

Best regards

I agree. Here's the link:
subject: Forward servlets