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
1
vote
3 answers

Groovy + Dropwizard and servlet 3.1.0 issue

I am trying to create a simple REST server using groovy 2.4.1, based on Dropwizard framework 0.8.1. The groovy script I'm using for this proof of concept is: import com.codahale.metrics.annotation.Timed import com.google.common.base.Optional import…
Radu C.
  • 11
  • 3
1
vote
3 answers

Why can't I find method setContentLengthLong(long len) in HttpServletResponse?

I am in Eclipse and some time ago I was using this method: http://docs.oracle.com/javaee/7/api/javax/servlet/ServletResponse.html#setContentLengthLong(long) Now I can't manage to mek it work. I am using JDK 1.7 and I have inserted the following…
Ariel
  • 1,222
  • 2
  • 14
  • 25
0
votes
1 answer

Async feature in Servlets

I was just going back to Servlet-3.x features and exploring it. If I am not wrong, before Servlet-3.x it was thread per request model and it would run out of threads in the pool, for heavy incoming traffic. So, with Servlet-3.x it says it is…
srk
  • 4,857
  • 12
  • 65
  • 109
0
votes
1 answer

How to init Weld 3.0 cid setParameterName on Tomcat 8.5/Servlet 3.1

I'm trying to upgrade an old web app from JSF 2.1.1-FCS to 2.2.14 running in the Tomcat 8.5 Servlet 3.1 container. The Mojarra JSF minimum requirements (for the latest version I guess, the page doesn't seem clear) says among other things that CDI…
jla
  • 6,904
  • 2
  • 36
  • 34
0
votes
1 answer

request forwarding with ServletHttpHandlerAdapter spring web-flux in servlet 3.1 container

As per documentation on servlet 3.1 container ServletHttpHandlerAdapter can be registered as a servlet and can support nio. I need to forward request to some other resource as below…
Gajendra Kumar
  • 908
  • 2
  • 12
  • 28
0
votes
1 answer

isReady() returns true in closed state - why?

ServletOutputStream.isReady() javadoc says the following: Returns: true if a write to this ServletOutputStream will succeed, otherwise returns false. In spite of that Jetty's ServletOutputStream implementation, HttpOutput seems to behave…
palacsint
  • 28,416
  • 10
  • 82
  • 109
0
votes
1 answer

How to convert web.xml to @WebServlet?

I have a web application with servlet 3.1 and have servlet filter without @WebFilter annotation and its working fine. I want to replace it with @WebServlet annotation but using same old filter without creating new filter class and using @WebFilter…
0
votes
1 answer

WAS 9 how to use servlet 3.0 in Websphere 9?

As per the given specs WAS9 is using JAVAEE 7 and related specs . I want to use servlet spec 3.0 due to some constraints . Is there any way to configure it . I am using plain profile (No liberty profile). The constraints is I am having two servlets…
optional
  • 3,260
  • 5
  • 26
  • 47
0
votes
1 answer

GAE Java 8 Runtime: java.nio.file.InvalidPathException: Illegal char <:> at index 68 in request URL

I use Spring MVC (not Spring Boot) for my Google App Engine REST based web-app. Today I upgraded GAE Java runtime to 1.8 (Java 8) and servlet-api 3.1. AppEngine SDK version 1.9.56. All the spring beans load perfectly without any error. I get this…
Amit
  • 496
  • 7
  • 11
0
votes
1 answer

Using @WebServlet annotation in external java project

I'm trying to work only with native java without using frameworks such as spring, struts etc. I'm building a web application using servlets and jsps. My project layout in Project explorer (in Eclipse): MyApp (java project), MyAppWEB (dynamic…
0
votes
1 answer

javax ServletInputStream.isFinished() - abstractMethodError

Trying to host solr 5.0 in jetty 8. This line in solr codebase (the isFinished() method) was throwing a NoSuchMethodException since I was using servlet API 3.0. The error was replaced with AbstractMethodException when I upgraded to…
0
votes
0 answers

shiro integrate spring with servlet3.1, tomcat can not start

shiro config @Configuration @ComponentScan({ "com.butler.service" }) public class SpringShiroConfig { @Bean public EhCacheManager ehCacheManager() { EhCacheManager ehCacheManager = new EhCacheManager(); …
aduan
  • 27
  • 2
  • 7
0
votes
1 answer

AuthenticationEntryPoint dependent on required roles

Alternate titles How do I get the mapped Method from an HttpServletRequest? How to apply WebSecurityConfig based on @Secured annotations rather than paths? Problem I have a Spring MVC server using @Secured annotations to specify the required roles…
OrangeDog
  • 36,653
  • 12
  • 122
  • 207
0
votes
1 answer

Using Nonblocking I/O feature of Servlets 3.1 on tomcat 8

Has anyone tried Servlets 3.1 non blocking technique on tomcat? The request from the browser seems to be waiting forever but when I run the server in debug mode, the call returns but still I don't see "Data read.." and "Data written.." in the…
John Eipe
  • 10,922
  • 24
  • 72
  • 114
0
votes
1 answer

Embedded Jetty 9 with async Servlets throws NullPointerException at org.eclipse.jetty.server.Request.extractFormParameters(Request.java:326)

I have an application using embedded Jetty 9.2.6 with annotated async Servlets (and I use Facelets to create interface templates). There is a random exception that occurs when I access any Servlet with asyncSupported = true. Here is one stack trace…
reinaldoluckman
  • 6,317
  • 8
  • 42
  • 50