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

  • Home
  • SEARCH
  • 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 6814821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:44:02+00:00 2026-05-26T20:44:02+00:00

I am trying to pass two parameters i.e. ( nomComposantARejouer , typeFileARejouer ) to

  • 0

I am trying to pass two parameters i.e. (nomComposantARejouer, typeFileARejouer) to an action method (gestionnaireMessagesController.rejouerMessage) using the setPropertyActionListener (we use jsf 1.2).

Here is the relevant jsp code:

<h:column>
<h:columnHeaderFacet>
<h:columnHeader value="#{msgs['pilotage.coordinateur.libelle.rejouer']}" />
</h:columnHeaderFacet>
<h:commandLink id="rejouer"
value="#{msgs['pilotage.coordinateur.libelle.rejouer']}"
action="#{gestionnaireMessagesController.rejouerMessage}">
<f:setPropertyActionListener
target="#{gestionnaireMessagesController.nomComposantARejouer}"
value="#{gestionnaireMessagesController.nomComposant}" />
<f:setPropertyActionListener
target="#{gestionnaireMessagesController.typeFileARejouer}"
value="#{gestionnaireMessagesController.typeFile}" />
</h:commandLink>
</h:column>

However, I always get a NPE because both parameters are null when used in the action method:

public String rejouerMessage() {
    log.debug("-->"+nomComposantARejouer);//null
    ParamResultatMessagesDTO message= (ParamResultatMessagesDTO) messagesTableau.getRowData();
    log.debug("MessageId: " + message.getMessageId());
    try {
        Pager p = Pager.getInstance();
        ParamRejouerMessageDTO prm = new ParamRejouerMessageDTO();
        prm.setMessageId(message.getMessageId());
        prm.setFileGet(nomsFilesMap.get(nomComposantARejouer).get(typeFileARejouer));
        prm.setFilePut(nomsFilesMap.get(nomComposantARejouer).get("TASKQ"));
        RejouerMessageService serv = (RejouerMessageService) this.getService(ServiceCst.REJOUER_MESSAGE_SERVICE);
        serv.rejouerMessage(prm);
    } catch (BusinessException e) {
        this.addMessage(e);
    } catch (ServiceException e) {
        this.addMessage(e);
    }


    return chargerPage(); // TODO Navigation case.
}

I am not sure what I am getting wrong. Can anyone please help?

FYI, the variables nomComposant and typeFile can be displayed without problem and are not null.

Also ignore the h:columnHeaderFacet tags. They are inhouse tags that I’ve renamed.

  • 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-05-26T20:44:02+00:00Added an answer on May 26, 2026 at 8:44 pm

    You’re basically doing:

    gestionnaireMessagesController.setNomComposantARejouer(gestionnaireMessagesController.getNomComposant());
    gestionnaireMessagesController.setTypeFileARejouer(gestionnaireMessagesController.getTypeFile());
    

    during the invoke action phase of the form submit. Both properties are in the same bean instance and copied shortly before action method is invoked. This makes no sense. You seem to be expecting that the value is evaluated during the request of displaying the form. You seem to be thinking that <f:setPropertyActionListener> sets a request parameter. This is not true. The <f:param> is the only which does that.

    So, this should do,

    <f:param
        name="nomComposantARejouer"
        value="#{gestionnaireMessagesController.nomComposant}" />
    <f:param
        name="typeFileARejouer"
        value="#{gestionnaireMessagesController.typeFile}" />
    

    in combination with the following on <managed-bean> of gestionnaireMessagesController in faces-conig.xml:

    <managed-property>
        <property-name>nomComposantARejouer</property-name>
        <value>#{param.nomComposantARejouer}</value>
    </managed-property>
    <managed-property>
        <property-name>typeFileARejouer</property-name>
        <value>#{param.typeFileARejouer}</value>
    </managed-property>
    

    (you can if necessary remove ARejouer so that it reuses the same property)

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

Sidebar

Related Questions

im trying to pass two parameters to a function, i being an int value
What I am is trying to do is the following. Pass two parameters to
I'm trying to pass two parameters to a JavaScript function. Unfortunately this give me
I am trying to pass two parameters in my navigate URL to request them
I am trying to pass two parameters to a thread in C. I have
I'm trying to pass in an unknown number of parameters (from 1-10) using an
How can I pass two querysting parameters in URL routing using ASP.NET 4.0? I
I'm trying to pass an instance of a class between two separate classes, like
I am trying to make an app that will pass data between two servers
In my GWT project, I'm trying to get it so two DialogBoxes can pass

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.