File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Problem with HTML:FORM tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with HTML:FORM tag" Watch "Problem with HTML:FORM tag" New topic

Problem with HTML:FORM tag

Brian Boyle

Joined: Nov 17, 2003
Posts: 13
I am writing an application with JSPs and I am using the struts framework. I am also using Struts JSP Tags in my JSP. I am having a problem with the <html:form> tag. I have a do/while loop embedded in my JSP as a scriplet. Ths scriplet is inside my <html:form> tags and it is giving me the following 3 errors:
'try' without 'catch' or 'finally'. if (_jspx_th_html_form_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)

'while' expected. } finally {

'finally' without 'try'. } finally {

If I take the form's closing tag and put it before the end of the loop, then I do not get the error. However I must have it after the loop. So it seems that the </html:form> tag has problems with loops in scriplets. Has anyone experienced this before?
Hope someone can help
Here is the relevant portion of my JSP code. Thanks

</tr> </table> <% x++; }while(iter.hasNext()); %> </br> <table width="20%" border="0" align="center"> <tr> <td width="48%"> <div align="center"> <html:submit title="Vote"/> </td> </tr> </table> </td> </tr> </html:form></table>
Srikanth Shenoy
Ranch Hand

Joined: Jan 24, 2004
Posts: 184
Can you post the entire <html:form>....</html:form> with the do while loop
Author: Struts Survival Guide - Basics to Best Practices

Srikanth Shenoy
Author of Struts Survival Guide : Basics to Best Practices
Brian Boyle

Joined: Nov 17, 2003
Posts: 13
I fixed this. I had started my do/while loop before my <html:form> tag. So basically, I should have had my entire loop inside my form, and thats what was causing the problem.
I agree. Here's the link:
subject: Problem with HTML:FORM tag
jQuery in Action, 3rd edition