| Author |
EL and ? : construct
|
DenisS Simpson
Greenhorn
Joined: Feb 10, 2006
Posts: 4
|
|
I am trying to do something like this ${true ? 'A': 'B'} but I get an error An error occurred while evaluating custom action attribute "value" with value "${true ? 'A' : 'B'}": Encountered "?", expected one of ["}", ".", ">", "gt", "<", "lt", "==", "eq", "<=", "le", ">=", "ge", "!=", "ne", "[", "+", "-", "*", "/", "div", "%", "mod", "and", "&&", "or", "||"] (null) According to O'Reilly's "JavaServer Pages" condition ? ifTrue : ifFalse operator is allowed. Is book wrong? PS I am using WebLogic
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
|
|
|
What version of JSP are you using? The ternary operator was introduced to the EL with JSP 2.0.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
DenisS Simpson
Greenhorn
Joined: Feb 10, 2006
Posts: 4
|
|
JSP 2.0 Running on WebLogic 8
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
|
|
Should work then. I use it regularly on Tomcat 5 and Resin 3. Is your web.xml declared as a Servlets 2.4 deployment descriptor? If not, the EL shouldn't be enabled on the pages at all, but I don't know how closely weblogic follows the JSP 2.0 spec and it might just be using some weird pre-JSP 2.0 compatability mode.
|
 |
DenisS Simpson
Greenhorn
Joined: Feb 10, 2006
Posts: 4
|
|
|
I don't have an entry for Servlets 2.4 descriptor.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56224
|
|
See this JSP FAQ entry. [ February 10, 2006: Message edited by: Bear Bibeault ]
|
 |
 |
|
|
subject: EL and ? : construct
|
|
|