Posts

extracting value from database with hibernateTemplate with where clause

List < Customer > customerList = ( List < Customer >) hibernateTemplate . find ( "FROM Customer c where c . accountNo = ?0 and c . password = ?1 " , accountNo , password ); if ( customerList . size () != 0 ) return customerList . get ( 0 ); return null ;

hibernateTemplate null

 You should always declear everything though bean once using spirng mvc, you cannot make your own class inside. where you have to call other class for service logic.  Only model class can be declear statically

Problem with hibernateTemplate null

Increase Menu Font Size Photoshop, window 10

Image
  Right click on the PS icon in the start menu and choose  Open File Location . Right click on the PS icon you see now and choose  Properties . On the  Compatibility  tab, click  Change high-DPI Settings . Choose  System  or  System (Enhanced)  as below.   Click  OK  and close these Windows. The next time you open Photoshop from this icon, it will scale properly. Repeat this process for any other Shortcuts (desktop/taskbar) that you use to open PShop.

To Use public resources directly in project

< mvc :annotation-driven /> < mvc :resources mapping ="/resources/**" location ="/WEB-INF/resources/" />

Redirection in mvc

@RequestMapping ( "/one" ) public String one () { return "redirect:/enjoy" ; } @RequestMapping ( "/enjoy" ) public RedirectView enjoy () { RedirectView r = new RedirectView (); r . setUrl ( "contact" ); return r ; }

Using of @ModelAttribute

@RequestMapping (value = "/processform" , method = RequestMethod . POST ) public String handleForm ( @ModelAttribute User user , Model m ){ return "contactSucess" ; } // it works three works // replace @RequestParam // do not have use Model // do not need to create model of user and set it in model.setAttribute("user", user) // it can be use on top of method @ModelAttribute public void commonDataForModel ( Model m ) { m . addAttribute ( "Header" , "0BIT1NP" ); m . addAttribute ( "Desc" , "Paving Digital path of Nepal" ); } // this commonDataForModel will execute before other method // Set the value for attribute for all methods