Posts

Spring Auto-Wiring Beans with @Autowired annotation

In Spring, you can use @Autowired annotation to auto wire bean on the setter method, constructor or a field. There are two ways to can achieve it : 1.Using <context:annotation-config />     Just Add Spring context and <context:annotation-config /> in bean configuration file <beans xmlns="http://www.springframework.org/schema/beans"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"     xmlns:tx="http://www.springframework.org/schema/tx"     xmlns:context="http://www.springframework.org/schema/context"     xsi:schemaLocation="http://www.springframework.org/schema/beans     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd     http://www.springframework.org/schema/aop     http://www.springframework.org/schema/aop/spring-aop.xsd     http://www.springframework.org/sche...

Error:No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here

To solve this problem. You have to do two things: 1. mark the DAO as transactional or function which is doing database call like:   @Transactional    public class EmployeeDaoImpl  extends DaoImpl implements EmployeeDao{  ///// }            OR @Transactional     public long addEmployee(Employee employee) {         System.out.println("Employee:"+employee );         long id = employeeDao.addEmployee(employee);         System.out.println("Id1: " );         return id;     } 2. Enable the annotation driven transcation management in applicationContext.xml (where your beans are defined): <beans xmlns="http://www.springframework.org/schema/beans"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="ht...

Keyboard Shortcuts That Work in All Web Browsers

Tabs Ctrl+1-8 – Switch to the specified tab, counting from the left. Ctrl+9 – Switch to the last tab. Ctrl+Tab – Switch to the next tab – in other words, the tab on the right. ( Ctrl+Page Up also works, but not in Internet Explorer.) Ctrl+Shift+Tab – Switch to the previous tab – in other words, the tab on the left. ( Ctrl+Page Down also works, but not in Internet Explorer.) Ctrl+W , Ctrl+F4 – Close the current tab. Ctrl+Shift+T – Reopen the last closed tab. Ctrl+T – Open a new tab. Ctrl+N – Open a new browser window. Alt+F4 – Close the current window. (Works in all applications.) Mouse Actions for Tabs Middle Click a Tab – Close the tab. Ctrl+Left Click, Middle Click – Open a link in a background tab. Shift+Left Click – Open a link in a new browser window. Ctrl+Shift+Left Click – Open a link in a foreground tab. Navigation Alt+Left Arrow, Backspace – Back. Alt+Right Arrow, Shift+Backspace – Forward. F5 – Reload. Ctrl+F5 – Reload and...