Skip to Content

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


http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/c87f41849d030de10000000a1550b0/frameset.htm
Methods of JSPDYNPAGE

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.


To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. Prem Mascarenhas
    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?
    (0) 
    1. Anonymous
      HI Prem

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

      (0) 
      1. Prem Mascarenhas
        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.
        (0) 
        1. Anonymous
          Hi Prem,
          Soory Prem Got late while replying ..as 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.
          Thnkx
          Pankaj
          (0) 
  2. Anthony Ananich

    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=”package.name.ClassName”>

    (0) 
    1. Anonymous
      Hi Anton,

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

      Thanx
      Pankaj Prasoon

      (0) 

Leave a Reply