Posts

Showing posts from September, 2018

Spring practice 2

package com.spring.practice; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @Controller @RequestMapping("/hi.mandip") public class MySpringMvcAnnotationController { @RequestMapping(method = RequestMethod.GET) public String sayHi(ModelMap model) { model.addAttribute("message", "Hi All! Welcome to Spring MVC Framework. WHHHOOOOOO!!"); return "hi"; } } ------------------------------- package com.spring.practice; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @Controller @RequestMapping("/hello.mandip") public class MySpringMvcAnnotationControllerHello { @Req...

REST API

REST - REpresentational State Transfer is a web based architecture and uses HTTP protocol for data communication. The following HTTP methods are commonly used in REST architecture: GET, PUT, DELETE, POST 1) Create "Dyanamic Web Project" - Add web.xml while creating Java Dynamic Web Project. 2) Import Jersey Jar file inside lib folder in WEB-INF. (Get Jersey Jar File from https://jersey.github.io/download.html)

Jersey JAX RS Jar

Go to: https://jersey.github.io/download.html Jersey JAX-RS 2.1 RI bundle  bundle contains the JAX-RS 2.1 API jar, all the core Jersey module jars as well as all the required 3rd-party dependencies.

Tomcat Installation Steps for Windows & add tomcat to eclipse

Tomcat is an open source java application server provided by Apache, it is the most popular application server for java environment. 1. Prerequisite Tomcat doesn’t work without java, so before installing tomcat on the machine, you should install a compatible java runtime version and setup  JAVA_HOME   environment variable. Both java and tomcat versions should be compatible so i recommend to always install the same version for java and tomcat, in this tutorial we use java 8 and tomcat 8. 2. Installation Download the windows service installer from  here :  https://tomcat.apache.org/download-80.cgi Install the downloaded file, pass all the setup until reaching  Configuration Options . here you can set the service name, the shutdown port and the running port of tomcat, by default tomcat runs on port 8080,  so i recommend to keep the default configuration as it is, you can always change these configuration after the in...