Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9086371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:28:24+00:00 2026-06-16T21:28:24+00:00

Here is sample code that throws a Servlet Exception as invalid expression error. data

  • 0

Here is sample code that throws a Servlet Exception as invalid expression error.

data Types are thus:

boolean: bean1.isValid1
boolean: bean1.isValid2
boolean: bean1.isValidSubCondn

String: bean2.StringData1 
String: bean2.StringData2 

want to use this inside JSTL tag:

 <x:div id="someID" 
               rendered='#{!bean1.isValid1 || bean1.isValid2 ? (bean1.isValidSubCondn ? bean2.StringData1.matches("^a|^b") : bean2.StringData2.matches("^c|^d") ) : "true"}'>

Now if this works, I would like to add a method call instead of doing the RegEx check within the JSP itself. That doesn’t work either – probably has to do with the same syntax issue.

[ServletException in:/beanName.jsp] 
 Invalid expression:
  '${!bean1.booleanProperty1 && bean1.booleanProperty2? (beanInstance.booleanProperty3 ? beanName.methodName1(bean2.stringProperty) : beanName.methodName1(bean3.stringProperty) ) :'true'}'' 

My JSP code is thus:

   <x:div id="something" rendered="#{not bean1.booleanProperty1 or (bean1.booleanProperty2 ? (beanInstance.booleanProperty3 ? beanName.methodName1(bean2.stringProperty) : beanName.methodName1(bean3.stringProperty) )) :true}"> 

This doesn’t work either:

   <x:div id="something" rendered="#{!bean1.booleanProperty1 || bean1.booleanProperty2 ? (beanInstance.booleanProperty3 ? beanName.methodName1(bean2.stringProperty) : beanName.methodName1(bean3.stringProperty) ) :true}"> 

The beanName.methodName1 is thus:

public boolean methodName1(String stringValuex) {
    if(stringValuex.matches("^A|^B"))
        { return true; }

   return false; 
 }

alternatively, I tried using the getter/setter method approach in the bean class, to get and set the property. Doesn’t work in the JSP either. Not sure how to resolve.
I need to perform a validation using a bean data of another class to display certain results.

Here is the setter/getter approach, need to figure out how to use this, then, in the JSP validation.

   <x:div id="something" rendered="#{!bean1.booleanProperty1 and bean1.booleanProperty2 ? (beanInstance.booleanProperty3 ? beanName.booleanFieldName(bean2.stringProperty) : beanName.booleanFieldName(bean3.stringProperty) ) : true}"> 

beanName.java class

 private boolean booleanFieldName = false;
   public boolean getbooleanFieldName() {
        return this.booleanFieldName;
    }

    public void setbooleanFieldName(String valueToTest) {
         if(valueToTest.matches("^a|^A"))
            { this.booleanFieldName= true;
            }
        this.booleanFieldName= false; 
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T21:28:27+00:00Added an answer on June 16, 2026 at 9:28 pm

    You can’t mix types in a ternary, and you are mixing booleanwithString“true”`.

    Try this, replacing "true" with true:

    rendered='#{!bean1.isValid1 || bean1.isValid2 ? (bean1.isValidSubCondn ? bean2.StringData1.matches("^a|^b") : bean2.StringData2 .matches("^c|^d") ) : true}'>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the sample code that I ran on Visual Studio 2010: #include <iostream>
Here is the sample code, which produces interesting output: > gg<-data.frame(x=c(a,b),y=as.integer(c(1000,100000))) > gg x
here is some sample code, it seems that it doesn't work for me. public
Here is my sample code... I am facing problem that my swingWorker extended class
I got some sample code from the net here: http://www.javadb.com/sending-a-post-request-with-parameters-from-a-java-class That works fine. It
Here is a simple code that shows what I think is a bug when
Here's the code for a simple page I have that is not working: <head>
enter code here Hi All, I have a simple windows service application that connects
Here's an sample code, where only the string object is released. NSString *nameOfFile =
Here's the sample code: public static void col (int n) { if (n %

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.