posted 9 years ago
Hi,
I have been trying to call a method within <c:if>, but then it threw me Scripting elements ( <%!, <jsp:declaration, <%=, <jsp:expression, <%, <jsp:scriptlet ) are disallowed here...at
The code is given below:
<c:if test="${actionbean.commiterrormsg eq 'connection closed'}" >
<%
actionbean.startTransaction();
%>
</c:if>
What I am doing here is to check if error msg is "connection closed", if it is then I need to call the method startTransaction in ActionBean class.
Can someone pleaseeeeeeeeee help me.. Seems like it does not allow scriplets with <c:if>...
Thanks a ton in advance
I have been trying to call a method within <c:if>, but then it threw me Scripting elements ( <%!, <jsp:declaration, <%=, <jsp:expression, <%, <jsp:scriptlet ) are disallowed here...at
The code is given below:
<c:if test="${actionbean.commiterrormsg eq 'connection closed'}" >
<%
actionbean.startTransaction();
%>
</c:if>
What I am doing here is to check if error msg is "connection closed", if it is then I need to call the method startTransaction in ActionBean class.
Can someone pleaseeeeeeeeee help me.. Seems like it does not allow scriplets with <c:if>...
Thanks a ton in advance
Anjali Raman
Ranch Hand
Posts: 57
posted 9 years ago
Thanks a lot for the reply
Bear Bibeault wrote:The whole purpose of the JSTL and EL is to eliminate scriptlets from JSP pages, They are not meant to be used together, and mixing them in a page just makes a mess.
Processing should occur in the page controller, before the JSP page is forwarded to.
Thanks a lot for the reply

