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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:00:36+00:00 2026-06-15T04:00:36+00:00

I am using <s:set var=buttonText value=getText(‘person.button.add’)/> in JSTL to use buttonText variable to set

  • 0

I am using <s:set var="buttonText" value="getText('person.button.add')"/> in JSTL to use buttonText variable to set text.

Someone tell me how to accomplish this in JSF EL please?

Question asked here IF-ELSE condition in JSF form. Need to know right approach but told to ask as a separate question.

EDITED:

I already added a link above for detail but here is again.

I am using JSTL like in struts2 project

 <s:if test="person==null || person.id==null || person.id==''">
                <s:set var="buttonText" value="getText('person.button.add')"/>
            </s:if>
            <s:else>
                <s:set var="buttonText" value="getText('person.button.edit')"/>
            </s:else>

I want to use same approach in JSF2 but with Expression Language. I am saving value in a variable called buttonText and accessing it below somewhere like #{buttonText}. I need solution to how to write variable in EL and use it. Hope its clear.

I need solution to <s:set var="buttonText" value="getText('person.button.add')"/> line of code only.

Thanks

  • 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-15T04:00:37+00:00Added an answer on June 15, 2026 at 4:00 am

    You can use ui:param

    In the following ways:

    <ui:param name="buttonText" value="#{myBean.MyValue}" />
    

    or

    <ui:param name="buttonText" value="someText" />
    

    or

    <ui:param name="buttonText" value="someText#{myBean.MyValue}" />
    

    and use later on like this

    <h:outputText value="#{buttonText}"/>
    

    Another option would be using <c:set in the following way

    <c:set var="buttonText" value="#{myBean.MyValue}" />
    

    But note that <c:set is a JSTL tag,

    JSTL tags runs during building the view (when the XHTML file is converted to
    JSF component tree)

    Also you might want to read this JSTL in JSF2 Facelets… makes sense?

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

Sidebar

Related Questions

I have try { using (var eventWaitHandle = EventWaitHandle.OpenExisting(name)) { eventWaitHandle.Set(); } Environment.Exit(0); }
Here is the code that I am using to set the api url: var
I am looking for a way to add a button to a jQuery button-set
I use the following query to get a result set var overlaps = from
How to set an option in select by text using jQuery? The following works
Im creating several grids with data using this code: @foreach(var set in viewModelEnvironment.SystemEnvironmentVariabelSets) {
Using Linq, trying to select all records not in my local set fails: var
I am trying to build up a jQuery set using add() but my implementation
Im using the plugin detailed here: http://www.thatagency.com/design-studio-blog/2009/01/refreshing-an-element-at-a-set-time-interval-using-jquery-and-a-sprinkle-of-ajax/ Here is my jQuery: $(document).ready(function(){ var j
I'm using set with templates in c++: template<typename TKey,typename TValue> class OMSSVDisk : public

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.