Solved

"if" tag without strut

Posted on 2009-07-02
7
442 Views
Last Modified: 2013-11-24
I've saw that in struts we've a "<s:if". Because I don't use strut, how to do it? I've many case where it would be very usefull!
0
Comment
Question by:Nargzul
7 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 450 total points
ID: 24764955
Use the JSTL tags?

<c:if  should work



http://java.sun.com/products/jsp/jstl/
0
 
LVL 1

Author Comment

by:Nargzul
ID: 24766307
I've tried but I've some problem:

Caused by: org.apache.jasper.JasperException: /Menu.jsp(10,62) PWC6314: According to the TLD, the attribute test is not a deferred-value or deferred-method, but the specified value contains a #-expression

with this code:


    <c:if test="#{sessionInformations.authentificationUser}">
        
    </c:if>

Open in new window

0
 
LVL 1

Author Comment

by:Nargzul
ID: 24766485
I've change the # by $ and it works. can someone explain me why?
    <c:if test="${!sessionInformations.authentificationUser}">
 
    </c:if>

Open in new window

0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 3

Expert Comment

by:serrutom
ID: 24767741
Use following:
<h:panelGroup rendered="${!sessionInformations.authentificationUser}">
   ...
</h:panelGroup>

Open in new window

0
 
LVL 1

Author Comment

by:Nargzul
ID: 24767866
It's not only for display element, I've by exemple "jsf:forward" elements.

As I've said it's work now, can you just say me why we must use a $ and not a # like I've done since there
0
 
LVL 7

Assisted Solution

by:gudii9
gudii9 earned 50 total points
ID: 24768317
usually expression language, jstl tags etc use $ related syntax...
0
 
LVL 1

Author Comment

by:Nargzul
ID: 24768630
Strange, I've used the #{} since there and this is the first time I've this problem.

Thank you
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java Jpanels and Jframe 8 32
Java - Why doesn't this JFrame work 3 58
javap bin 2 34
maven module vs maven project 3 21
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to implement Singleton Design Pattern in Java.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question