Solved

"if" tag without strut

Posted on 2009-07-02
7
439 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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 …

758 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now