Skip to main content

Posts

Showing posts from January, 2016

Spring MVC Job Scheduling

Create a Spring MVC project  Open spring tool suite File > New > Spring Project > Spring Mvc Project Test whether the project is working, if it's ok you should see a hello page in your browser. Adding Dependency Add following to pom.xml.         <dependency>             <groupId>org.springframework</groupId>             <artifactId>spring-core</artifactId>             <version>${springframework.version}</version>         </dependency>         <dependency>             <groupId>org.springframework</groupId>             <artifactId>spring-context</artifactId>             <version>${springframework.version}</version>         </dependency>  Create the scheduler This is the class you want to schedule. Name it as ScheduledTasks.java and place with homecontroller.java import java.text.SimpleDateFormat; import java.util.Date; import org.springframework.scheduling.anno

ActiveMQ Hello World with Maven Web Spring Mvc

Create a spring mvc project Open  Spring Tool Suite (STS). Mine is 3.6.4 File > New > Spring Project > Spring Mvc Project Test whether the application is running perfect. If it's running ok you will see a new page openned in browser containing following If you face errors try to update maven dependencies as right click on project > maven > update project Project Structure gowild.jsp add a new jsp to view folder home.jsp add a link in the home page to new page New Controller Method Add a new controller method to home controller page so it will handle new page requests Testing Test whether the application running. you should get a new link in the home page which points to the new jsp page. Pom.xml Now lets add activemq dependencies through pom.xml. add following to the pom         <dependency>             <groupId>org.apache.activemq</groupId>             &