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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:11:11+00:00 2026-06-14T20:11:11+00:00

I am writing an application with Java EE using JSF 1.2 and the Seam

  • 0

I am writing an application with Java EE using JSF 1.2 and the Seam framework. I have a form which takes input from radio button like this:

<h:selectOneRadio value="#{testAction.selectedOptionId}"
                 id="selectedQuestionOption"
                 layout="pageDirection">
    <s:selectItems var="selectedOption" value="#{currentQuestion.options}"
                   label="#{selectedOption.optionString}"
                   itemValue="#{selectedOption.optionId}"/>
 </h:selectOneRadio>

 <h:commandButton id="goToNextQuestion" value="Submit"
                 action="#{testAction.postAnswer}"/>

I want that, I would accept the result if anyone submits the form without selecting a radio button, but it does not work. Because in the validation phase jsf rejects the submission and results in a validation error. I tried to write a custom validator for it, unfortunately that also did not worked for me.

Any suggestion?

  • 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-14T20:11:12+00:00Added an answer on June 14, 2026 at 8:11 pm

    I did not find any solution to this problem by writing a custom validator which should be the ideal solution in this case. But I found a work around to overcome this situation. I can bypass the binding value and validation phases by setting immediate = "true" of the submit button like this:

     <h:commandButton id="goToNextQuestion" value="Submit" immediate="true"
                 action="#{testAction.postAnswer}"/>
    

    By doing this skipping the subsequent phases faces servlet will go to invoke application phase and your application logic will be applied and as you skipped the processing phases the data from your post request will not be bind to your beans. So before working with those beans you should read their value from the RequestParameterMap like I did bellow(in my case):

        Map<String, String> paramMap = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
    
        for (String key : paramMap.keySet()) {
            //log.info("Param: " + key + " Value: " + paramMap.get(key));
            if (key.contains("selectedQuestionOption")) {
                //log.info("OptionParam: " + key + " Value: " + paramMap.get(key));
                selectedOptionId = Integer.parseInt(paramMap.get(key));
            }
        }
    

    and then applied my real business logic.

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

Sidebar

Related Questions

I have weird problem. I'm using Eclipse for writing J2EE (java, jsf, javascript) application
I am writing an application in java (1.6) using swing. I currently have a
I am writing a java application that takes schema-bounded XML as input and needs
I am writing a web application using JSF 2. I have downloaded mojarra-2.1.3-FCS-binary.zip and
I am writing a java application using swing in which I need to draw
i am writing a web application with jsf 2.0 and using primefaces framework. i
I'm writing a small demo application in Java using Spring, that needs to have
Writing a Java application using the Play framework and need some HTTP-Live streaming. I
I am writing a Java application that takes command line arguments which are processed
I am writing a client-server application using Java-RMI. Some server-side ressources have to be

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.