Spring 3.1 - Servlet 3-based configuration using the Jetty Maven plugin

I am trying to integrate new spring 3.1 features with annotations to provide configuration information for a web application.

I installed the maven-jetty-plugin version 8.0.4.v20111024 version to run my application. When you launch the berth using the mvn jetty: run command, everything looks fine and configured correctly. But when accessing the application through the browser, there is only the default servlet output.

It seems that this was a simulated problem that tomcat had in previous versions (<= 7.0.14) https://issues.apache.org/bugzilla/show_bug.cgi?id=51278

Currently, I cannot use the pier, and I had to switch to the tomcat plugin to deploy my application to tomcat.

Does anyone have any suggestions on how to overwrite the default servlet at startup if there is no web.xml?

+2
source share
1 answer

You do this by overriding the default marina configuration, put this in your plugin:

<configuration> <scanIntervalSeconds>0</scanIntervalSeconds> <webAppConfig> <defaultsDescriptor>src/main/resources/webdefault.xml</defaultsDescriptor> </webAppConfig> </configuration> 

Copy the webdefault file with Jetty and comment out this part:

 <!-- <servlet-mapping> --> <!-- <servlet-name>default</servlet-name> --> <!-- <url-pattern>/</url-pattern> --> <!-- </servlet-mapping> --> 
+1
source

Source: https://habr.com/ru/post/1395100/


All Articles