0

How do I pass parameters from ServletOne to ServletTwo using a HTTP POST through URL intead of using HTTP GET in the servlet?

For example: http://localhost/ServletOne?username=test

If the above link is accessed, in ServletTwo, username test will be displayed.

1 Answer 1

1

You've a problem in your class design. The ServletTwo has apparently some code which needs to be reused in ServletOne. You need to refactor that code into a separate Java class. Once done that, all you need to do is to just import/use that Java class in both servlet classes the usual Java way.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.