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 7941045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:32:50+00:00 2026-06-03T23:32:50+00:00

I am getting an javax.el.ELException: java.lang.Short cannot be cast to java.lang.Long for the following

  • 0

I am getting an javax.el.ELException: java.lang.Short cannot be cast to java.lang.Long for the following code:

<ui:param name="aumSegmentType" value="#{segmentSetup.userSegmentTypes[2]}" />

I am using Mojarra 2.1, facelets.

  • 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-03T23:32:52+00:00Added an answer on June 3, 2026 at 11:32 pm

    That’s not possible. Numbers are in EL by specification treated as Long.

    If changing the map key type isn’t an option, then you need to create a method which takes a long and casts it to short.

    public SomeObject getUserSegmentType(long key) {
        return userSegmentTypes.get((short) key);
    }
    

    and use it as follows

    <ui:param ... value="#{segmentSetup.getUserSegmentType(2)}" />
    

    I of course assume that your environment already supports EL 2.2. It should, given the fact that you’re using JSF 2.1.

    Note that this problem is unrelated to JSF/Facelets.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting a class cast exception namely java.lang.ClassCastException: android.app.Application cannot be cast to greendroid.app.GDApplication
I keep getting a ClassCastException Exception in thread main java.lang.ClassCastException: java.lang.String cannot be cast
java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.String I am getting this exception in follwing
New to android programming. Getting Following error. 04-07 14:49:05.452: ERROR/AndroidRuntime(1566): FATAL EXCEPTION: main java.lang.OutOfMemoryError
I'm getting a java.lang.ClassNotFoundException: javax.ejb.EJBObject error when I'm running my application as a JAR
I'm trying to run the Terasort benchmarks and i'm getting the following exception: java.lang.RuntimeException:
I'm getting the following NullPointerException: Exception in thread AWT-EventQueue-0 java.lang.NullPointerException at com.foo.JawsFileChooser.a(SourceFile:28) at com.foo.JawsFileChooser$1.actionPerformed(SourceFile:91)
<oxm:jaxb2-marshaller id=marshaller> <oxm:class-to-be-bound name=myclass/> </oxm:jaxb2-marshaller> I keep getting exception: java.lang.NoSuchMethodError: org.springframework.http.MediaType.sortBySpecificity(Ljava/util/List;)V What is the
Getting these errors in some java code http://tutorials.jenkov.com/java-multithreaded-servers/multithreaded-server.html Exception in thread Thread-0 java.lang.RuntimeException: Cannot
I keep getting this java.lang.NullPointerException on the line where mLoginButton's onClickListener is initiated. I

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.