Gauravu,
This question is close enough to:
https://coderanch.com/t/291249/JSP/java/Conditional-script-let-tag-java that I think it would be better to continue the discussion there.
The answer is the same as the ones given there.
Javascript is interpreted on the client's machine, in a browser.
JSP is interpreted on the server and is, in effect, done and finished before the Javascript even starts.
For this reason, there is no way to conditionally execute JSP code based on branches in your Javascript.
One workaround to this is AJAX but I wouldn't recommend tinkering with AJAX until you have a firm grip on HTTP; at least as far as understanding what happens on the server and what happens on the client.
If you have any further questions, ask in your other
thread.
-Ben
[ January 10, 2007: Message edited by: Ben Souther ]