Questions tagged [servlet-3.1]

A Servlet 3.1 (JSR-340) specification targeted to the Java EE 7 platform.

A Servlet 3.1 (JSR-340) specification targeted to the Java EE 7 platform. Servlet 3.1 was in Public Review in Janurary 2013. And it is in Proposed Final Draft now. Most of the new features are related to security. In this following, I will highlight features since Servlet 3.1 Public Review:

  • add new API javax.servlet.http.Part#getSubmittedFileName
  • add new API javax.servlet.ServletContext#getVirtualServerName This API allows a JASPIC module to be registered in a Servlet container in a portable way.

  • default deny semantic

Prior to Servlet 3.1, if the given HTTP methods are not covered by the given security constraint for given URL patterns, then the HTTP methods are not protected for the corresponding URL patterns. This may not be the desired behavior. A new element deny-uncovered-http-methods is added to web.xml so that the behavior of those HTTP methods for the given URL patterns can be configured easily.

  • authenticated role,

If the role name is not explicitly defined in web.xml, it is used to denote the role name of all authenticated users. The role name can be used in defining an security-constraint in web.xml and as argument of HttpServletRequest#isUSerInRole.

46 questions
36
votes
1 answer

Java - Async in Servlet 3.0 vs NIO in Servlet 3.1

Until now, as it applies to serving http requests, I thought the terms - asynchronous and non-blocking i/o meant the same thing. But apparently, they have been implemented separately in servlet 3.0 and 3.1 respectively. I am struggling to understand…
code4kix
  • 3,937
  • 5
  • 29
  • 44
18
votes
4 answers

How to use servlet 3.1 in spring mvc?

There are 2 different features available: servlet 3.0 allows to process request in a thread different from the container thread. servlet 3.1 allows to read/write into socket without blocking reading/writing thread There are a lot of examples in…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
7
votes
1 answer

Warning: JACC: For the URL pattern xxx, all but the following methods were uncovered: POST, GET

In javax.faces.webapp.FacesServlet docs, it is mentioned, Allowable HTTP Methods The JSF specification only requires the use of the GET and POST http methods. If your web application does not require any other http methods, such as PUT and…
Tiny
  • 27,221
  • 105
  • 339
  • 599
6
votes
2 answers

Servlet asynchronous processing support in App Engine Java 8 standard environment

I'm trying asynchronous processing support in servlet 3.1 with GAE J8 standard environment (no extensible environment). Basically I have a servlet annotated with @WebServlet(name = "MyServletName", urlPatterns = {"/dosomething"}, asyncSupported =…
sbibiz
  • 133
  • 8
6
votes
2 answers

What is the benefit of Async Servlets

I was reading up on Async servlets 3.1 It is said that the thread that sends the request is freed up when there is lot of time consuming operations to be done for e.g. fetching long list of data from the database. I am not able to understand the…
Nick Div
  • 5,338
  • 12
  • 65
  • 127
6
votes
2 answers

WriteListener (servlet 3.1) semantics

Let's say I'm writing chunks of data to an HttpServletResponse. So my method receives an array of bytes, I write it to response.getOutputStream(), and then I release the thread. When I receive another chunk of data, my method will be awaken, and it…
Luciano
  • 8,552
  • 5
  • 32
  • 56
5
votes
3 answers

Loop through an Enumeration containing Header Names in Java Servlet

I want to loop through an enumeration containing all of the header names inside a java servlet. My code is as follows: public class ServletParameterServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request,…
Dewey Banks
  • 323
  • 1
  • 7
  • 19
4
votes
1 answer

Is there analog of AsyncContext in spring mvc?(how to write http response in another thread)

I have google about spring support of servlet 3.0/3.1 specification and most of information I have found at this article: Understanding Callable and Spring DeferredResult Here author say that you can return Callable or DefferedResult from controller…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
4
votes
2 answers

web.xml not found in Java EE7 project

I'm doing a project in eclipse with JSF 2.2 and Servlet 3.1 (Java EE7). The first problem I had was a error in the pom.xml in line: war Error: web.xml is missing and is set true. I researched on the internet and added the…
user2733757
  • 171
  • 3
  • 11
4
votes
1 answer

Migrating from web.xml to Java based configuration - unable to start Tomcat 8

I am trying to migrate my app's web.xml to Java based configuration. We are using spring 4.1, Java 7, Servlet 3.1, Tomcat 8 and Eclipse Luna. The web service framework is Jersey 2.14. I used mainly the following guide:…
Eyal
  • 1,748
  • 2
  • 17
  • 31
4
votes
0 answers

Injecting configured values into Spring 4 WebApplicationInitializer

I have a web application using Spring 4 and servlet-api 3.1 in which I am using AbstractAnnotationConfigDispatcherServletInitializer to initialize the DispatcherServlet and ContextLoaderListener via annotated @Configuration java-config Spring app…
Christopher
  • 206
  • 2
  • 4
3
votes
3 answers

SpringBoot Application not getting started because of servlet-api

hello all sorry for my English first. I am trying to startup my springboot app but it is not getting started because of servlet-api 3.1 and older version conflict but i don't know which dependency is getting conflicted for this, hope some can help…
user3458271
  • 638
  • 12
  • 31
3
votes
3 answers

Cannot get Tomcat 8.0 with Servlet 3.1 working with JSTL 1.2

I have read through nearly every answer to this question on SO and have tried over a dozen different "solutions" but I cannot get JSTL to work in a Spring boot web app using servlet 3.1 within Tomcat 8.0. I continue to receive this error: The…
Matt Crysler
  • 865
  • 3
  • 11
  • 23
2
votes
1 answer

How to take advantage of non-blocking requests in Spring Web MVC Controllers

I am trying to demonstrate the advantages of using Reactive Streams in Spring MVC. For that I have a small Jetty server running with two end-points: /normal returns a POJO /flux returns the same object wrapped in a Mono Then I start a client and…
Druckles
  • 3,161
  • 2
  • 41
  • 65
2
votes
2 answers

Understanding Jetty's "Closed while Pending/Unready" warning

We have an asynchronous servlet which produces the following warning log from Jetty: java.io.IOException: Closed while Pending/Unready After enabling debug logs I got the following stacktrace: WARN [jetty-25948] (HttpOutput.java:278) -…
palacsint
  • 28,416
  • 10
  • 82
  • 109
1
2 3 4