Back to feed
Renewal·서른의 생활코딩

Hello World: STS 4.0.1 (Spring Boot) + Maven Build

NS
normalstory
cover image

(Work-in-progress tutorial. For now, just a series of screenshots. When time permits, I'll add descriptions and link to GitHub for each image. For now, the file is attached.)


Hello World: STS 4.0.1 (Spring Boot) + Maven build  

Source: 

startSpringWithMaven20190123.zip
Download


1. Right-click > New > Other


2. Select Maven Project

3. Tick the first checkbox 'Create a simple project', then click Next>

4. Fill in the project details in the form, then click Finish.

5. Verify the newly created project.

6. Clicking the project name expands the tree.

7. Open pom.xml and add the required dependencies.

8. Select the project title and right-click. Choose 'Java EE Tools' near the bottom and click 'Generate Deployment Descriptor Stub.'

9. A web.xml file gets created at src/main/webapp/WEB-INF/.


10. Open the generated web.xml and first, in the XML DocType declaration on the second line, change the javaee version to 3.0.

11. Now configure the filter, contextConfigLocation, and DispatcherServlet.

12. Select the project name and right-click. Choose 'Maven' near the bottom and click 'Update Project.' 

13. Check that the selected project is ticked in the list, click OK, and you'll see the green progress bar busily working in the bottom-right.

14. Maven setup is done. Now let's set up the Tomcat server. From the top Window menu, choose 'Show View' and click 'Other.'

15. In the new window, select 'Servers' and click Open.

16. You'll see the Servers tab added at the bottom-left.

17. Click the blue link and a New Server window pops up. Pick the same Tomcat version that's installed on your machine.

18. Select the directory where Tomcat is installed and click Next.

19. Pick the project to connect to the server you just set up. (For now the left list has only one, but remember later there might be several.) Select it and hit the Add button in the middle.

20. The selected project has moved to the right. Click Finish to complete the connection.

21. In the bottom-left pane you can see the project name added beneath the server.

22. Now let's tweak the project's path settings. Select the project, right-click, and this time click Properties at the bottom.

23. From the list on the left, pick Web Project Settings.

24. On the right, change the Context root to '/' and click Apply.

25. Double-click the server name you just created. A 'Web Modules' area appears on the right with the project you connected.

26. Click the project name inside 'Web Modules' — the Edit Web Module window opens.

27. Check the Path and change it to '/'.

28. In the Web Modules list, verify the modified Path was applied.

29. Select the resource package path, hit Ctrl+N, search for 'pack' in the Words field, and double-click the result.

30. Configure the path and name of the new resource package.

31. After setting the path and name of the new resource package, reopen the web.xml you wrote earlier.

32. In web.xml, set the servlet-context path and configuration.

33. In the newly created resource package, at the same path you set in web.xml, create root-context.xml and servlet-context.xml.

34. Open the newly created root-context.xml and configure the service and repository contexts.

35. Open the newly created servlet-context.xml and set base-package and view.internal paths.

36. Let's create the view page. Select the webapp folder and press Ctrl+N — in the New window, type 'jsp' in the Words field and you'll see options like below.

37. Select jsp, click Next, enter the file name (index.jsp), then press Enter or Finish.

38. Double-click the newly created index.jsp and you'll see the source on the right. Add a script inside <head></head>.

39. Now let's create a controller. Select the first package directory and press Ctrl+N to open the wizard. Type 'class' in Words, select it, and click Next.

40. The New Java Class page opens — enter the class name or package path to create.

41. Write the controller class.

42. Map the redirect path set in index.jsp to the controller class.

43. Select the WEB-INF folder, press Ctrl+N, type 'folder' in Words, pick it from the list, and click Next. 

44. Name the folder 'view' to match the bean property name you set in servlet-context.xml, then click Finish. 

45. Create helloMaven.jsp inside the view folder. Code it keeping in mind the path-mapping between java, xml, and jsp. 

: URL:8081 -> web.xml ->  index.jsp -> root-context.xml -> mavenController.java -> servlet-context.xml -> helloMaven.jsp 

46. Select the server at the bottom-left and click the green play button to start Tomcat — confirm ['http-Bio-8080'] comes up properly.

46. Open a browser and enter localhost:8080 in the address bar.

47. Browser result.










This English version was translated by Claude.

zipstartSpringWithMaven20190123.zip
친절한 찰쓰씨
Written by
친절한 찰쓰씨

Pleasant Charles — UI/UX researcher at AIT. Keeping notes on design, planning, and slow days here since 2010.

More on the author's page

Keep reading

Renewal

Steadily, for the long haul, without burning out

Mar 31, 2026·9 min
Renewal

Tech-life balance

Feb 7, 2026·3 min
Renewal

Humanality, by Park Jeong-ryeol

Feb 7, 2026·11 min