Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Checkboxes and If Statements

843840Jun 30 2009 — edited Aug 5 2009
I am working on a JSP page and I'm having some trouble. I have a series of checkboxes and under certain circumstances they are supposed to be checked and along with that given certain criteria they are supposed to be enabled or disabled but I'm not having any luck getting this to work. Below is my code:
<% if (my_method.getVariable1() != null && my_method.getVariable1().equals("Y") ) { %>
		checked
	<% } %>
  </% else if (my_method.getVariable2().equals("J") && (my_method.getVariable3().equals("A") || my_method.getVariable3().equals("D") ) ) { %> 
	disabled
  <% } %>
  </% else { %>
  enabled/>
  <% } %>
Right now when I run this and try to access the page I'm getting the following error:
1455
 [jsp src:/jsp/contract/DisplayPage.jsp:line #:862]
while expected }  
1456
 [jsp src:/jsp/contract/DisplayPage.jsp]
'(' expected __ojsp_s_out.write(__oracle_jsp_text[334]);  
50
 'try' without 'catch' or 'finally' try {  
2579
 expected __ojsp_s_out.write(__oracle_jsp_text[753]);  
2583
 'class' or 'interface' expected catch( Throwable e) {  
2596
 'class' or 'interface' expected }  
4114
 'class' or 'interface' expected 
Any help would be appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 2 2009
Added on Jun 30 2009
22 comments
860 views