Skip to Content
Author's profile photo Former Member

JspDynPage with Client Side Eventing and Database

The blog enlighten a user how to create a JspDynPage, what precisely happens when we create a JspDynPage? And what Bean Should we choose? using client side eventing the jsp page , accessing a database from the application.

A JspDynPage consists of three types of file.

    • .java file
    • Bean file
    • Jsp file

The most significant thing when we create a JspDynPage is what kind of Bean should be used .The answer to this is “ it depends what exactly your application want “

    1. Create a JspDynPage
    2. .While Creating a Jsp Dynpage you need to choose the type of the Bean. The Details about the scope of bean is explained very methodically at

Our objective now is to fetch the data entered in the UI. Following Code Snippet shows how to pick data for the elements defined in the HTMLB in JAVA file.

Here the value obtained is stored inside the variable sFname which is defined globally .( that is why we are using “this” operator)


    1. Storing Data in the database. Please Once go through the concepts of Prepared and callable statements .(NOTE :- The code uses prepared statement as we are trying to insert a value in the database.insert is a DDL statement.)

I have more or else covered what I intended to do so .I have not put in all the codes since the basic intension of mine was to make user aware of the way .

I may have missed on Certain aspects .Please let me know so that next time I can rectify these.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Hi, This is a vey good blog indeed. Could you also add on to this as to where you would code the database update statements? Would you put this in the methods called say on submit? e.g "onClick" or so?
      Author's profile photo Former Member
      Former Member
      HI Prem

      The database insert or update staements has to be placed in the
      public void doProcessAfterInput() throws PageException .

      Author's profile photo Former Member
      Former Member
      Hi Pankaj,
      I needed some more help. Can you tell me how you went about creating the datasource in the Portal database.Is connection to portal database as simple as using the Connection class with driver because I saw some forums talking about doing a JNDI lookup using Context etc. Can you please tell me or give some really simple references how to connect to portal database using the default datasource.
      Thanks a lot.
      Author's profile photo Former Member
      Former Member
      Hi Prem,
      Soory Prem Got late while replying i ws out of station.See Here i used the database where my WAS is installed.So did nt had much trouble as it was as simple the as setting the normal connection.I havent worked with JNDi so cant tel much about that.
      Author's profile photo Former Member
      Former Member

      You wrote:<br/><jsp:useBean id="myBean" scope="application" class="bean.Filename"> <br/><br/>Should be written:<br/><jsp:useBean id="myBean" scope="application" class="">

      Author's profile photo Former Member
      Former Member
      Hi Anton,

      Truly pointed by you .By mistake wrote the name of the package rather than making it a generalized statement.

      Pankaj Prasoon