• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what's wrong with this code

 
Vicky Pandya
Ranch Hand
Posts: 148
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Merrill. That worked well.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic