Getting a servlet to spawn its own "submit"

C

Cali Hotstuff

Currently I have a setup where an html form 'a' submits to servlet
'A', which redirects the user to page 'b'.

I need to change this to something where 'a' submits to servlet 'B',
which itself simulates a submit to servlet 'A' and then redirects to
'b' (ie B submits to A, A's redirect is ignored, B redirects user to
b). I'm guessing that from servlet B I need to somehow build my own
Request or Response object, redirect it to A, and then redirect the
user's response object to b. Unfortunately, if this even is the right
route to take, I can't figure out how to construct my own
request/response...

Any suggestions? I can be more specific with the details if need be.

Many thanks,
cali
 
W

William Brogden

Cali Hotstuff said:
Currently I have a setup where an html form 'a' submits to servlet
'A', which redirects the user to page 'b'.

I need to change this to something where 'a' submits to servlet 'B',
which itself simulates a submit to servlet 'A' and then redirects to
'b' (ie B submits to A, A's redirect is ignored, B redirects user to
b). I'm guessing that from servlet B I need to somehow build my own
Request or Response object, redirect it to A, and then redirect the
user's response object to b. Unfortunately, if this even is the right
route to take, I can't figure out how to construct my own
request/response...

The servlet API provides the handy HttpServletRequestWrapper
and HttpServletResponseWrapper classes you can extend.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top