Samik
Samik

Reputation: 29

How to keep JSP files in two or more different folders with Springboot?

I have a demo SpringBoot Project integrated with jsp running fine.

So that jsp files can be detected I have kept them in say /WEB-INF/view/jsp1.

So for that in my application.properties file I have mentioned this two lines-

spring.mvc.view.prefix=/WEB-INF/view/jsp1/

spring.mvc.view.suffix=.jsp

and the application is running fine.

Now if I want to keep some more jsp files this time in /WEB-INF/view/jsp2 folder. How to achieve that?

Upvotes: 0

Views: 964

Answers (1)

IMParasharG
IMParasharG

Reputation: 1895

Your application.properties

spring.mvc.view.prefix: /WEB-INF/view/
spring.mvc.view.suffix: .jsp

Your controller method i.e.

    @RequestMapping("/one")
        public String one(Map<String, Object> model) {
                    return "jsp1/one";
        }

 @RequestMapping("/two")
        public String two(Map<String, Object> model) {
                    return "jsp2/two";
        }

Upvotes: 2

Related Questions