Saturday, October 4, 2014

Struts2 insertion process in netbeans

       Struts2 is one of the mostly used java framework.Its advantages are
  • AJAX support
  • Easy to integrate
  • Easy to modify
  • Uses Plain Old Java Objects

Now coming to insertion on a mysql table with struts2.
  1. First we have to create the project in netbeans as shown in these screenshots.












  2. Now create the index.jsp under webpages folder which have a form .


  3. Then create a new java package under Source packages.



  4. Then create a java class under the register package.


  5. Then write this java code in register.java.Dont forget to fill getters and setters.

  6. Then create the 2 jsp pages that needs to view our results.




  7. Then change the web.xml,struts.xml files according to your processes.


  8. Database actions.
    Db name-strutslogin
    Table name - login
    Columns - id,username,password



Finally its done ....:-)

No comments:

Post a Comment