Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

           suppose your are creating a module that needs to have access to patient information. Assuming that the class is called Patient. 

                  The following code can be used a pojo of a class patient

                  public class Patient{

                 //These can also be called attributes

                    public String FirstName;

                    public String LastName;

                    public integer Age;

                //getters and setters method

               public String getFirstName(){

                                return FirstName;

             }

            public String getLastName(){

             return LastName;

       }

       public Integer Age(){

      return age;

     }

}

Note forgetting setters methods and also creating constructor methods.  Most IDEs help us in getting things done without wasting much time . Am using eclipse IDE , so you open your class(patient class in this case)→ right click→ source→Generate getters and setters method. you can continue and provide constructor or to String method depending o n your needs.(Model handles the bussiness logic of the application)

...

      public class Controller(){

     }

}

      Note: You should include the @controller on top of class to show that it is a controller class and also to be able to call the specified url. 

J encourage to read about introduction to spring framework to have to learning materials. 

...

                     Any addition on this edit is highly appreciated and comments.(raff  need your comments or review of this if it is helpfull or what j need to add)

  



   

                   

            }