Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336220

Summary: tmp directory is not set if you reload a webapp with jetty-maven-plugin
Product: [RT] Jetty Reporter: Peter Schmidt <gevatter.tod>
Component: serverAssignee: Jan Bartel <janb>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jetty-inbox
Version: 7.2.2   
Target Milestone: 7.2.x   
Hardware: PC   
OS: All   
Whiteboard:

Description Peter Schmidt CLA 2011-02-03 07:31:07 EST
when you run jetty with the jetty-maven-plugin and reload a webapp, ServletContext.getAttribute("javax.servlet.context.tempdir") will return null


because of this line in AbstractJettyMojo.configureWebApplication the tmp directory is only set once:

if ( webAppConfig.getTempDirectory() == null && tmpDirectory != null) {
     ...
     webAppConfig.setTempDirectory(tmpDirectory);


but WebAppContext.setTempDirectory sets the attribute "javax.servlet.context.tempdir"


summary:
-you stop the webapp
-all attributes are cleared
-WebAppContext.setTempDirectory is not called anymore so "javax.servlet.context.tempdir" will not be set
Comment 1 Jan Bartel CLA 2011-05-25 22:14:32 EDT
Fixed for jetty-7 head. svn rev 3270.