The address URL changes but the broswer output is same as of t2.jsp
broswer output should be of t1.jsp i.e.
t1jsp------t2jsp
______
|submit|
_______
q1.Why am I getting such behaviour ?
-----------------------------------------------------------------------------------------------------------------
If i remove the following code from web.xml,the request from t2.jsp is mapped to /tests/*.
should'nt the request for tests in the form tag i.e.
t2.jsp
go to an error page eg-"page not found" as no match would be found for it for tests.
THough there is a mapping to /tests/* but its different from tests.
q2.Why is the request from t2.jsp is mapped to /tests/* if code as specified above is removed from web.xml ?
Step 2: Right now address is http://localhost:8080/Scwcd/tests/b.jsp now when you click on submit, the action is "tests" which is a relative address. That means that the request will go for http://localhost:8080/Scwcd/tests/tests Container looks for any direct matches for url pattern /tests/tests but it does not find any, So then it looks for /tests/* and finds it to be mapped to TestS1 which is t2.jsp.
I dont see any unexpected behavior. It is what it should be.