2

I have spring boot application and i'm using embedded tomcat as web server. I have problem with listing directories. I want to now how could i enable or disable listing directories in embedded tomcat. In none spring boot application we can do it adding code below in web.xml:

<init-param>
       <param-name>listings</param-name>
       <param-value>false</param-value>
</init-param>

how can i Enable/disable directory listing in spring boot?

I have found only question below in stackoverflow but didnt help.

Embedded Tomcat directory listing for spring-boot application

Hadi Rasouli
  • 1,871
  • 3
  • 27
  • 43

1 Answers1

0

When it comes to spring-boot, pretty much everything can be micro-managed via configuration files.

You can pass init-param values to the embedded container using the following properties

server.servlet.jsp.init-parameters.*= # Init parameters used to configure the JSP servlet.

in your case,

server.servlet.jsp.init-parameters.listings=false
Raja Anbazhagan
  • 4,092
  • 1
  • 44
  • 64