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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:24:35+00:00 2026-06-13T18:24:35+00:00

How could I always convert the property username to lower case? This does not

  • 0

How could I always convert the property username to lower case?

This does not work:

<h:inputText value="#{userService.user.username.toLowerCase()}" />

as target gets “unreachable” by this.
How could I else do this?

  • 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-13T18:24:36+00:00Added an answer on June 13, 2026 at 6:24 pm
    <h:inputText value="#{userService.user.username.toLowerCase()}" />
    

    You can’t perform a “set” operation on the given EL expression, while this is mandatory in order to update the model value with the submitted value. The toLowerCase() method expression doesn’t have a corresponding setter method.

    Technically, you should be creating a Converter for the job. Here’s a kickoff example:

    @FacesConverter("toLowerCaseConverter")
    public class ToLowerCaseConverter implements Converter {
    
        @Override
        public String getAsString(FacesContext context, UIComponent component, Object modelValue) {
            if (!(modelValue instanceof String)) { 
                return null; // Or throw ConverterException.
            }
    
            return ((String) modelValue).toLowerCase();
        }
    
        @Override
        public Object getAsObject(FacesContext context, UIComponent component, String submittedValue) {
            if (submittedValue == null) { 
                return null;
            }
    
            return submittedValue.toLowerCase();
        }
    
    }
    

    Use it as follows:

    <h:inputText value="#{userService.user.username}" converter="toLowerCaseConverter" />
    

    You should preferably not clutter the model with conversion strategies.

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

Sidebar

Related Questions

This question could be a can of worms, but I've always wondered if it
hey guys was hoping you could help me out, Not sure if I always
Could someone please tell me why this <%= destroy_password_url @user.password_reset_token %> generates http://localhost:3000/api/destroy_password.4G5EoRVYMUAtiIKqOerKsw routes.rb
I've always assumed that DbNull.value was a singleton. And thus you could do things
I always thought that you could use OR in a LIKE statment to query
I've always thought it was great that I could use simple iconic unicode characters
I've always been impressed by the StackOverflow hive mind, and was hoping you could
ModelState is always returning null in my unit tests. I was hoping someone could
Instead of having to type tmux every time, how could I have tmux always
I've always wondered. I know that compilers convert the code you write into binaries

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.