run java code on clicking Submit button in JSP form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • laxmisharma
    New Member
    • May 2013
    • 5

    run java code on clicking Submit button in JSP form

    I want to run java code on clicking Submit button in JSP form. I want to use the information given in the form in java code.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Post the form data to a servlet.

    Comment

    • laxmisharma
      New Member
      • May 2013
      • 5

      #3
      Okay. Does the answer remain the same if the Java code that I want to run does nothing but generate a PDF file containing the information submitted in the form?
      Also, I don't know how to have the form information contained in PDf file which to be generated.

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Yes, you can generate PDFs from servlets just fine. You'll need some PDF libraries like iText for creating the pdf

        Comment

        • laxmisharma
          New Member
          • May 2013
          • 5

          #5
          I downloaded the iText jar file, but I don't know where exactly should I put it.

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            It should end up in your web application's WEB-INF/lib.
            If this is your first web application the you should start with a tutorial on servlets and JSPs

            Comment

            • laxmisharma
              New Member
              • May 2013
              • 5

              #7
              Ok. Thank you very much for the information.

              Comment

              Working...