the above code line i have written in a B.java file. Now i want to change the "eventreg" boolean value to true or false according to the condition written in if loop.
But only that loop gets executed for the which the "eventreg" boolean value assigned in Java file.
So is it the correct method i am doing it.
1 - Scriptlet code in JSP is bad. This logic belongs in a bean/servlet somewhere. Java code should be in a java class.
2 - Is there anything that logically relates "a.jsp" to "b.java"???
If you want to share an object between a JSP page and code elsewhere, then you should probably use a java bean stored in the session.