Questions tagged [servlet-3.0]

Java Servlets 3.0 is a new API that supports extensibility/pluggability, Ease of Development (EoD) using the newer language features, Async and Comet support, Security, and other features being as part of the revision for Java EE 6.

Version 3 of the servlet API adds the following to version 2.5

  • async response
  • multipart support
  • annotation configuration (no web.xml)
  • generics in the API
  • resources (including JSPs) in JARs under META-INF/resources

Links

941 questions
24
votes
1 answer

Tomcat 7 session cookie path

I'm having a huge problem with my application and Tomcat 7. My application needs to set session cookie to "/" path instead of "/context" path. In tomcat 6 it was a matter of adding another property to Connector (emptySessionPath="true") and Tomcat 7…
Juriy
  • 5,009
  • 8
  • 37
  • 52
24
votes
1 answer

Java web app - What determines my Servlet API version? Does it get specified in web.xml?

I'm using Eclipse EE Juno and my current web application is using Dynamic web modules 2.4. I'm trying to bump the version up to 3.0 but for some reason I'm unable to. when I try to change the version in project facets I get Cannot change version of…
stackoverflow
  • 18,348
  • 50
  • 129
  • 196
22
votes
4 answers

.NET Core - Web API - How to do File Upload?

I am not able to figure out, how to write a .NET Core Web API to support File Upload. Please note I am not using ASP.NET Core MVC form for file upload but via a Servlet/JSP container. Here is how my project.json is defined, { "dependencies": { …
Rohit
  • 245
  • 1
  • 2
  • 6
22
votes
4 answers

What's the purpose of AsyncContext.start(...) in Servlet 3.0?

Servlet API says about "AsyncContext.start": void start(java.lang.Runnable run) Causes the container to dispatch a thread, possibly from a managed thread pool, to run the specified Runnable. The container may propagate appropriate contextual…
Aivar
  • 6,814
  • 5
  • 46
  • 78
21
votes
3 answers

How to programmatically setup a in Servlets 3.x?

In my current web application I am trying to get rid of web.xml and I have not been able to properly setup the security constraint that forces all requests to the application to use HTTPS.
ams
  • 60,316
  • 68
  • 200
  • 288
21
votes
7 answers

Spring Security without web.xml

What is the recommended way to add Spring Security to a web application that is using Spring's new WebApplicationInitializer interface instead of the web.xml file? I'm looking for the equivalent of:
Jeff
  • 3,669
  • 1
  • 23
  • 33
21
votes
5 answers

Using Spring MVC 3.1+ WebApplicationInitializer to programmatically configure session-config and error-page

WebApplicationInitializer provides a way to programmatically represent a good portion of a standard web.xml file - the servlets, filters, listeners. However I have not been able to figure out a good way to represent these elements(session-timeout,…
Biju Kunjummen
  • 49,138
  • 14
  • 112
  • 125
18
votes
6 answers

SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer

I am attempting to move a xml-based Spring MVC app to a Java Configuration based app. There appears to be a mismatch with the various java.servlet classes available in maven. For instance, some provide the addServlet() method and some do not. Here…
Brian Dolan
  • 3,086
  • 2
  • 24
  • 35
16
votes
1 answer

Difference between HandlerInterceptor and WebRequestInterceptor?

While writing interceptor for my application I noticed HandlerInterceptor and WebRequestInterceptor here. I noticed that HandlerInterceptor's method take HttpServletRequest, HttpServletResponse, Object(handler) and other params while…
optional
  • 3,260
  • 5
  • 26
  • 47
16
votes
3 answers

Spring Boot does not honor @WebServlet

I created a Servlet (extending from HttpServlet) and annotated as per 3.0 specs with @WebServlet(name="DelegateServiceExporter", urlPatterns={"/remoting/DelegateService"}) My @Configuration class in Spring Boot scans this servlet's package.…
Jason
  • 2,006
  • 3
  • 21
  • 36
14
votes
1 answer

Spring: Why "root" application context and "servlet" application context are created by different parties?

As I understand, a Spring based web application is initialized as below: Step 1: Servlet container (e.g. Tomcat) locates the implementation of ServletContainerInitializer, which is SpringServletContainerInitializer. Step 2:…
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
14
votes
1 answer

Usage of AsyncListener#onError

I don't understand when AsyncListener#onError method is called. Javadoc doesn't help: Notifies this AsyncListener that an asynchronous operation has failed to complete. How could it fail? How can I reproduce this error? UPDATE: // in HttpServlet…
dream brother
  • 315
  • 2
  • 9
13
votes
3 answers

How to avoid request set ASYNC_SUPPORTED=true to enable async servlet 3.0 processing on Tomcat 7?

Following an issue reported on this question, a solution was found: req.setAttribute("org.apache.catalina.ASYNC_SUPPORTED", true); This seems a bit strange and is not really 'portable' code (it won't hurt, but...). It seems specific to Tomcat 7. I…
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
13
votes
2 answers

IllegalStateException: Not supported on AsyncContext.startAsync(req, res)

I have created a servlet 3.0 to explore asynchronous request processing: @WebServlet(name="MyTest", urlPatterns={"/MyTest"}, asyncSupported=true) public class MyTest extends HttpServlet { @Override public void doGet(HttpServletRequest req,…
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
13
votes
2 answers

How to config maven to use servlet 3

I want to upgrade my webapp to use servlet 3.0 (insetd of 2.5). I am using WebLogic Server Version: 12.1.1.0 (12c),maven,java 7_10 and NetBeans 7.3.1 For some reason the only available servlet-api is 3.0-alpha-1 and not 3.0
angus
  • 3,210
  • 10
  • 41
  • 71
1
2
3
62 63