0

I have a page in jsf, where the user enters all the data and clicks on submit button, and it has to be saved in the database. Please find the code i'm currently using.

 <h:column>
  <f:facet name="header">
    <h:outputText value="Registration"/>
  </f:facet>
  <h:form>
  <h:commandLink id = "submit" value="submit" action="#{bean.submitDate}">
      <f:param name="sNum" value="#{list.sNumber}" />
      <f:param name="firstName" value="#{list.fName}" />
      <f:param name="lastname" value="#{list.lName}" />
      ...
  </h:commandLink></h:form>
 </h:column>

i wanted know if i can send whole data at a time or I have to send all the fields individually itself as above

1 Answer 1

1

Although I don't see any input fields in your code snippet:

You can send all input elements together. Just let one single <h:form> ... </h:form> wrap all your input elements and use one h:commandLink or h:commandButton inside the form to submit all data together.

Sign up to request clarification or add additional context in comments.

4 Comments

can u be more clearer...i couldn't understand your solution.. As I'm new to jsf framework, getting stuck with many issues.. can i get a complete tutorial which describes how to do a registration where the user entered data should be submitted to database..I'm using JSF 2.0 with jsp
I can't provide a complete tutorial. Getting data from web interface into a database involves several steps. If you are on Netbeans I would recommend that you create your database for registration data and then follow the CRUD tutorial for JSF from the Netbeans Docs&Support section.
the tutorial you suggested was with facelets...but I'm using jsp
The code from your question is facelet code ... or did you switch. You can browse Netbeans Doc section. There are also examples with jsp.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.