-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Cleanup webappconfiguration #3703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ff67b37
646fa4f
89291bb
cf9a1f9
71e66ad
52c332a
4062cde
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,14 +32,10 @@ public WebAppConfiguration() | |
addDependencies(WebXmlConfiguration.class, MetaInfConfiguration.class, WebInfConfiguration.class); | ||
addDependents(JettyWebXmlConfiguration.class); | ||
protectAndExpose( | ||
"org.eclipse.jetty.util.log.", | ||
"org.eclipse.jetty.server.session.SessionData", | ||
"org.eclipse.jetty.servlet.StatisticsServlet", | ||
"org.eclipse.jetty.servlet.StatisticsServlet", | ||
"org.eclipse.jetty.servlet.DefaultServlet", | ||
"org.eclipse.jetty.servlet.NoJspServlet", | ||
"org.eclipse.jetty.continuation."); | ||
expose( // TODO Evaluate why these are not protectAndExpose? | ||
"org.eclipse.jetty.servlet.listener.", | ||
"org.eclipse.jetty.alpn."); | ||
"org.eclipse.jetty.servlet.NoJspServlet" | ||
); | ||
expose("org.eclipse.jetty.servlet.listener."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All these are classes/packages are in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really. servlet is usable without webapps. But configuration really about configuring webapps - specifically by a combination of convention and the configurations we push into it from our modules. If we wanted to move Configuration down to servlet, then we'd have to move the WebAppClassLoader (or at least an abstraction of it) down as well... and then we start having no difference between servlet and webapp. tl;dr; any direct users of jetty-servlet configure by using API directly and probably don't have a different classloader (maybe not even a context). |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,6 +141,7 @@ | |
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-servlets</artifactId> | ||
<version>${project.version}</version> | ||
<scope>provided</scope> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think they are portable. More over, the jetty-servlets module exposes them on the webapp classpath. Putting them in webapp just brings in all our io, http and util classes and exposes all the classloader problems that entails. |
||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.jetty.toolchain</groupId> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ | |
package com.acme.test; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.OutputStream; | ||
import java.util.Collection; | ||
|
||
import javax.servlet.ServletConfig; | ||
|
@@ -30,7 +32,6 @@ | |
import javax.servlet.http.HttpServletResponse; | ||
import javax.servlet.http.Part; | ||
|
||
import org.eclipse.jetty.util.IO; | ||
/** | ||
* MultiPartTest | ||
* | ||
|
@@ -58,7 +59,6 @@ public void init(ServletConfig config) throws ServletException | |
@Override | ||
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException | ||
{ | ||
|
||
try | ||
{ | ||
response.setContentType("text/html"); | ||
|
@@ -78,7 +78,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr | |
if (p.getContentType() == null || p.getContentType().startsWith("text/plain")) | ||
{ | ||
out.println("<p>"); | ||
IO.copy(p.getInputStream(),out); | ||
copy(p.getInputStream(),out); | ||
out.println("</p>"); | ||
} | ||
} | ||
|
@@ -116,8 +116,21 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) thro | |
throw new ServletException(e); | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
// TODO remove inline once 9.4.19 is released with a fix for #3726 | ||
public static void copy(InputStream in, | ||
OutputStream out) | ||
throws IOException | ||
{ | ||
int bufferSize = 8192; | ||
byte buffer[] = new byte[bufferSize]; | ||
|
||
while (true) | ||
{ | ||
int len=in.read(buffer,0,bufferSize); | ||
if (len<0 ) | ||
break; | ||
out.write(buffer,0,len); | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the reason to inline There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because you wouldn't let me do a release of a fixed jetty-util jar :) |
||
} |
Uh oh!
There was an error while loading. Please reload this page.