• Post Reply Bookmark Topic Watch Topic
  • New Topic

can a boolean value can be accessed from java file in scriplet

 
Dinesh Remje
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

the above code i have written in A.jsp file

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.

Thanks in advance.
 
Stefan Evans
Bartender
Posts: 1822
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!