Skip to content

ljv5555/spring-webmvc-servlet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-webmvc-servlet

simple spring boot servlet

to run:

mvn spring-boot:run -Drun.arguments="--server.port=9876"

or

mvn package && java -jar target/spring-webmvc-servlet-0.0.1-SNAPSHOT.jar --server.port=9876


package com.khs.sample.spring.servlet.springwebmvcservlet;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
public class MainServlet{
    @GetMapping
    public void getHandler(HttpServletRequest request, HttpServletResponse response) throws Exception
    {
        response.setHeader("content-type","text/plain");
        response.getWriter().append("Get endpoint.");
    }


}

About

simple spring boot servlet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published