jsp - How to evaluate a scriptlet variable in EL? -


i wondering if there anyway of using jsp in <c:if> statement.

e.g.

<c:if test="${ param.variable1 == 'add' <% jsp variable clause %>}"> 

so want jsp variable checked against well.

any suggestions? have tried ignorantly sticking in clause, did not work.

thanks

so want evaluate scriptlet variable in el? store request attribute.

<%     string var = "some";     request.setattribute("var", var); %>  <c:if test="${param.variable1 == 'add' && var == 'some'}"> 

however, makes no sense. should avoid scriptlets altogether , use jstl/el prepare variable. if make functional requirement more clear, e.g. "how do (insert scriptlet code snippet) using jstl/el?", we'll able suggest right approach.

for example, use <c:set> set variable in el scope.

<c:set var="var" value="some" scope="request" /> 

see also:


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -