• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what's wrong with this code

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to call different actions based on one of the parameters to URI. I have following simple if else condition to call diffrent actions. but I keep getting below exception.

<%if(request.getParameter("method").equals("Edit")){%>
<html:form action="existingControlAction">
<%}else{%>

<html:form action="addControlAction">
<%}%>

javax.servlet.jsp.JspException: ServletException in '/jsp/existingcontrol.jsp': /jsp/existingcontrol.jsp(169,0) The end tag "</html:html" is unbalanced
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:921)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460)
at org.apache.jsp.jsp.raedefaultlayout_jsp._jspx_meth_tiles_insert_1(org.apache.jsp.jsp.raedefaultlayout_jsp:204)
at org.apache.jsp.jsp.raedefaultlayout_jsp._jspx_meth_html_html_0(org.apache.jsp.jsp.raedefaultlayout_jsp:124)
at org.apache.jsp.jsp.raedefaultlayout_jsp._jspService(org.apache.jsp.jsp.raedefaultlayout_jsp:72)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Other way I tried is storing actionName in scriptlet in which depending on this parameter I create a String variable with action name but that also doesn't seeem to be working. <html:form action="<%=actionName%>"> is not working with error in tag.

Anybody, what's wrong?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try it this way:


also, check to make sure that you have matching <html:html> and </html:html> tags as well as matching <html:form> and </html:form> tags.
[ July 01, 2005: Message edited by: Merrill Higginson ]
 
Vicky Pandya
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Merrill. That worked well.
reply
    Bookmark Topic Watch Topic
  • New Topic