JSTL condition with multiple statements

I am trying to write a condition in JSTL that has several statements.

<c:if test="${!memberObj.provider && empty subscriptions or subscriptions eq false}"></c:if> 

The above is not done correctly because it should contain "empty signatures or eq false subscriptions."

I would expect that I could do:

 ${!memberObj.provider && (empty subscriptions or subscriptions eq false)} 

But the jsp page is empty when I do this. I think something is not working ...

How can I combine "and" and "or" operators in one condition in JSTL?

Thanks in advance!

+4
source share
1 answer

It looks valid (although a bit awkward, several styles are mixed and that a logical comparison is optional).

The browser may be empty if it received invalid HTML. I would argue that there is some other Java code in the code that throws an exception while the answer is already made. As soon as the answer is already made, the server will not be able to display the page with the error in its full glory (although it will register an exception). The browser will eventually receive a semi-processed answer with incomplete HTML that the browser cannot interpret in any reasonable way, so it will be empty.

+3
source

Source: https://habr.com/ru/post/1394267/


All Articles