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
2
votes
1 answer

Tomcat 8.5 threading model

My application uses Web Sockets via JSR 356 implementation by Tomcat 8.5 (servlet 3.1). According to the JSR, it is supposed to use NIO but I am not sure to understand. When a client requests a Web Socket connection, a permanent conversation is…
rico
  • 1,843
  • 2
  • 24
  • 41
2
votes
0 answers

Does Undertow support async I/O from an async source?

I have a scenario where I’m attempting to serve data in a non-blocking fashion which is sourced by a RxJava Observable (also non-blocking). I’m using the WriteListener callback provided by ServletOutputStream. I’m running into an issue where the…
2
votes
1 answer

How to use async servlet + non blocking IO for file download?

My image files are stored in database (I know they shouldn't be, but can't help). To be able to render them on clients, I've implemented an async servlet that helps read the binary stream off the database column and write on to the Output Stream of…
Chiranjib
  • 1,763
  • 2
  • 17
  • 29
2
votes
1 answer

Questions About Servlet 3.1 Non Blocking IO Sample

Below code are servlet 3.1 Non Blocking IO demo: UploadServlet: @WebServlet(name = "UploadServlet", urlPatterns = {"/UploadServlet"}, asyncSupported=true) public class UploadServlet extends HttpServlet { protected void doPost(HttpServletRequest…
Tony
  • 117
  • 1
  • 11
2
votes
1 answer

Command do not fire with multipart form (JSF 2.2)

I’ve been trying to use the new h:inputFile from JSF 2.2, but I cannot get it to work. Ever since I have changed the “enctype” attribute of the “h:form” tag, the action is not being invoked anymore. I have stripped my application from all Filters…
rvcoutinho
  • 326
  • 1
  • 10
1
vote
0 answers

How to build a raw non-blocking servlet

Is there over there a lot of examples about how to create "reactive" services using spring, or whichever microprofile implementation (quarkus, kuuluzee). According to Servlet 3.1, whichever servlet can be handled as "non-blocking". I figure out that…
Jordi
  • 20,868
  • 39
  • 149
  • 333
1
vote
0 answers

Using Async-IO of servlet3.1 with Spring

How to use Async-IO(setWriteListener) of Servlet3.1 with Spring-5 ? Also, I found Link-A which mentions one needs to add Listener to outputStream. On other hand Link-B says it should work with spring 5 and tomcat 8.5+. Next I profiled a JVM and…
Bhuvan
  • 4,028
  • 6
  • 42
  • 84
1
vote
0 answers

should tomcat's non blocking servlets get method call to read and write listener be synchronized?

I am trying to understand how non blocking io works in servlets. the code below is example that comes with tomcat to show functionality of a new servlet "NumberWriter". this servlet has one "doGet" method and one inner class "NumberWriterListener"…
tornike
  • 76
  • 3
1
vote
1 answer

"Closed while Pending/Unready" warnings from Jetty

After fixing synchronization issues in our async servlet we still got rare java.io.IOException: Closed while Pending/Unready warnings from Jetty. With the fixes above it decreased from ~90/day to ~5/day in our production system. It's rare and it…
palacsint
  • 28,416
  • 10
  • 82
  • 109
1
vote
1 answer

Connection pool based web server with async support vs Event Loop based web server

I'm learning about Vertx and it's ecosysteme, firstly i learned about Event loop, and the concept is really nice to me. But since Servlet 3.1 we can use async support in JAVA based servers. I'm using Spring and it's new class named deferredresult…
Almas Abdrazak
  • 3,209
  • 5
  • 36
  • 80
1
vote
0 answers

Tomcat8 - default error page not working

Tomcat 8 Servlet 3.1 I'm trying to get default error page to work. This post, for example, is what I'm trying to do. My web.xml
TedTrippin
  • 3,525
  • 5
  • 28
  • 46
1
vote
0 answers

Get unicode string in java servlet submitted from HTML form?

I stuck up while working with Unicode(Nepali) in Servlet. Well I submit (POST Method) HTML form and wanted to store in database. But could not get exact unicode. I tried following things - new…
Veshraj Joshi
  • 3,544
  • 3
  • 27
  • 45
1
vote
0 answers

Using @WebFilter and @WebListener vs and in web.xml (Jersy2 with Servlet 3.x)

I am trying to use java-melody in an web application for monitoring purposes. Dependency in build.gradle compile group: 'net.bull.javamelody', name: 'javamelody-core', version: '1.69.0' With web.xml (Works Fine)
Rajkishan Swami
  • 3,569
  • 10
  • 48
  • 68
1
vote
1 answer

How to get the ServletContext in Struts 2 factory classes

To access ServletContext in an Struts 2 factory class ( For example StrutsTextProviderFactory ) I used below code: public class CustomStrutsTextProviderFactory extends StrutsTextProviderFactory implements ServletContextListener{ private…
Alireza Fattahi
  • 42,517
  • 14
  • 123
  • 173
1
vote
1 answer

Maven, eclipse, servlet api 3.1.0. Eclipse complains "cannot change version of project facet Dynamic Web Module to 3.1"

I created a webapp using the maven simple webapp archetype, and then added the following dependency: javax.servlet javax.servlet-api 3.1.0
Periata Breatta
  • 468
  • 5
  • 14