Solved

"if" tag without strut

Posted on 2009-07-02
7
447 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
V.simple question about Android packages and libraries 1 38
How do I remove an object from a 3 53
Is there a simpler dropbox system? 10 44
web project error add remove 1 56
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

730 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