can a single servlet process 2 diffrent jsp pages?

I am kinda new to the jsp world. Here is the question i have.

I have 2 jsp pages and a sigle servlet class. Both the jsp pages need to be processed by the same servlet. The servlet needs to run diffrent logics based on which jsp the request is being sent from. Is there any way for the servlet to know which jsp the request is coming from( like having an attribute in the form tag of the jsp which the servlet can later retrieve)?

I am using only jsp's and servlet( not using any other technology like struts or JSf's). I appreciate any kind of help. Thank you.

[582 byte] By [reddyreddya] at [2007-10-3 0:32:41]
# 1

Yes, you can! It depends on how you access the servlet. If you access it via GET method you must add a request parameter to the url to distinguish from which jsp the request comes. If you use POST method (with form submission) put a hidden field in the form and with that field you can recognize from which jsp the request comes.

Message was edited by:

amittev

amitteva at 2007-7-14 17:26:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...