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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:16:11+00:00 2026-05-21T22:16:11+00:00

As I’m new to JSF framework, wanted to know how to add the user

  • 0

As I’m new to JSF framework, wanted to know how to add the user entered data to the database.
More clearly, i’m using jsf with jsp, my jsp contains some input fields and a submit button.How do i capture all the user entered data and send it as input paramters for the button, as my back end takes all these as input parameters and updates the table with a new record.

Please look into my code and lety me know my mistake

Registration.jsp

<body>
 <f:view>
  <h:form>
           <h:panelGrid columns="2" rules="all" width="100%" style="background:#03547C;color:#FDD017">
                <h:column>
                    <h:outputText value="Stu No : "></h:outputText>
                    <h:inputText value="#{RegBean.stuNo}"/>
                </h:column>
                <h:column>
                    <h:outputText value="Stu Name : "></h:outputText>
                    <h:inputText value="#{RegBean.stuName}"/>
                </h:column>
                 <h:column>
                      <h:outputText value="Standard : "></h:outputText>
                      <h:inputText value="#{RegBean.standard}" />
                 </h:column>
                 <h:column>
                       <h:outputText value="School : "></h:outputText>
                       <h:inputText value="#{RegBean.school}" />
                 </h:column>
            </h:panelGrid>
            <h:panelGrid columns="2" rules="all" width="100%" style="background:#03547C;color:#FDD017">
                <h:column>
                    <h:form>
                        <h:commandButton id="submitBtn" value="Submit" action="#{RegBean.submitDetails}">
                            <f:param name="sNo" value="#{RegBean.stuNo}" />
                            <f:param name="sName" value="#{RegBean.stuName}" />
                            <f:param name="std" value="#{RegBean.standard}" />
                            <f:param name="schl" value="#{RegBean.school}" />
                        </h:commandButton>
                    </h:form>
                </h:column>
            </h:panelGrid>
        </h:form>
    </f:view>
</body>

Registration Bean

public class VendorRegBean {
private String stuNo;
private String stuName;
private String standard;
private String school;

  // getters and setters

    public void submitDetails() {
    Map requestMap = context.getExternalContext().getRequestParameterMap();
      String stNo = (String) requestMap.get("sNo");
      String stName = (String) requestMap.get("sName");
      String stndrd = (String) requestMap.get("std");
      String scl = (String) requestMap.get("schl");
    vReg.stuRegistration(stNo ,stName ,stndrd ,scl );        
}

}

  • 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-21T22:16:11+00:00Added an answer on May 21, 2026 at 10:16 pm

    You don’t need to get the parameters from the request parameter map as long as you register your bean as managed bean and provide getter and setter methodes for your bean members.

    Use annotations for your bean to declare it as managed bean. Getter and setter example are given for stuNo member:

    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.SessionScoped;
    
        @ManagedBean
        @SessionScoped
        public class RegBean {
          private String stuNo;
          ...
    
    
          private String getStuNo() {
            return stuNo;
          }
    
          private String setStuNo(String stuNo) {
            this.stuNod = stuNo;
          }
        }
    

    In the view you have to reference the managed bean with first letter lower case, such as:

    <h:inputText value="#{regBean.stuNo}"/>
    

    Your command button doesn’t need <f:param>, simply use:

    <h:commandButton id="submitBtn" value="Submit" action="#{regBean.submitDetails}"/>
    

    Then all parameters are automatically available in your submitDetails method and you don’t need to get them from the parameter map.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.