use of io.undertow.servlet.core.ManagedServlet in project undertow by undertow-io.
the class HttpServletRequestImpl method parseFormData.
private FormData parseFormData() {
if (parsedFormData == null) {
if (readStarted) {
return null;
}
final ManagedServlet originalServlet = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY).getCurrentServlet().getManagedServlet();
final FormDataParser parser = originalServlet.getFormParserFactory().createParser(exchange);
if (parser == null) {
return null;
}
readStarted = true;
try {
return parsedFormData = parser.parseBlocking();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return parsedFormData;
}
use of io.undertow.servlet.core.ManagedServlet in project undertow by undertow-io.
the class HttpServletRequestImpl method setCharacterEncoding.
@Override
public void setCharacterEncoding(final String env) throws UnsupportedEncodingException {
if (readStarted) {
return;
}
try {
characterEncoding = Charset.forName(env);
final ManagedServlet originalServlet = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY).getOriginalServletPathMatch().getServletChain().getManagedServlet();
final FormDataParser parser = originalServlet.getFormParserFactory().createParser(exchange);
if (parser != null) {
parser.setCharacterEncoding(env);
}
} catch (UnsupportedCharsetException e) {
throw new UnsupportedEncodingException();
}
}
use of io.undertow.servlet.core.ManagedServlet in project undertow by undertow-io.
the class ServletContextImpl method getServletRegistration.
@Override
public ServletRegistration getServletRegistration(final String servletName) {
ensureNotProgramaticListener();
final ManagedServlet servlet = deployment.getServlets().getManagedServlet(servletName);
if (servlet == null) {
return null;
}
return new ServletRegistrationImpl(servlet.getServletInfo(), servlet, deployment);
}
Aggregations