PDA

View Full Version : [JSP/JSTL] Utilizzare i due metodi in un if


ianaz
01-12-2008, 17:26
Ho bisogno di fare un if con degli AND e degli OR con le JSTL e in un caso devo chiamare un metodo che necessita un parametro per cui devo per forza utilizzare <% %> e nell'altro chiamo normalmente${}.

Mi spiego meglio con un esempio:

<c:forEach ...>
<c:when test='<%=valore.isCliccato("Normale") == true%>'>
...
</c:when>
<c:when test="${messaggio.mittente.id == UtenteLoggato.id}">
...
</c:when>
.
.
</c:forEach>

Vorrei metterlo in un unico IF solamente che non posso mettere assieme i due metodi di verifica.. :S Spero d'essermi spiegato

ianaz
02-12-2008, 09:03
uppp

gokan
02-12-2008, 14:17
<c:set var="valore"><%=valore.isCliccato("Normale")%></c:set>
e poi usare ${valore} nell'altro test

ianaz
02-12-2008, 14:19
<c:set var="valore"><%=valore.isCliccato("Normale")%></c:set>
e poi usare ${valore} nell'altro test

Grazie mille, non c'avevo pensato :)

gokan
02-12-2008, 14:33
Prego ;)
Dovrebbe funzionare !

Hardware Upgrade Forum Database Error
Database Error Database error
The Hardware Upgrade Forum database has encountered a problem.

Please try the following:
  • Load the page again by clicking the Refresh button in your web browser.
  • Open the www.hwupgrade.it home page, then try to open another page.
  • Click the Back button to try another link.
The www.hwupgrade.it forum technical staff have been notified of the error, though you may contact them if the problem persists.
 
We apologise for any inconvenience.