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?