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

Prevent Execution of ServletContainerInitializer or how to use absolute-order

is it possible to prevent the execution of the ServletContainerInitializer of a provided jar. I want to prevent the execution of JerseyServletContainerInitializer.java which is provided by Glassfish 4.1 as an osgi-bundle (in…
drame
  • 435
  • 1
  • 4
  • 14
9
votes
1 answer

Using ServletContextListener with Jetty

I want to test my ServletContextListener with embeded jetty. It calls contextDestroyed on server stop but doesnt call contextInitialized on server start. How can I fix it? Server server = new Server(PORT); ServletContextListener myListener =…
Stan Kurilin
  • 15,614
  • 21
  • 81
  • 132
9
votes
2 answers

REST API with NIO?

I have worked in the construction of a public API that will have a lot of concurrent accesses and one of the aspects that I thought is to use Asynchronous I/O to consider the scalability aspect. Initially I thought in use Nginx as a HTTP Server…
Poulsen
  • 91
  • 1
  • 3
9
votes
2 answers

Embedded Jetty with annotated servlet patterns?

The following working code demonstrates including two servlets into an embedded instance of jetty. Server server = new Server(8080); ServletContextHandler context = new…
Jay
  • 19,649
  • 38
  • 121
  • 184
9
votes
3 answers

How to upgrade filters to support Servlet 3.0 asynchronous servlet

I have a servlet which is used to fetch data from many third party REST datapoints, integrate all the data and report the data in a HTML format. I also have a filter which has the following flow - Create an event record when the request hits the…
Shamik
  • 6,938
  • 11
  • 55
  • 72
8
votes
1 answer

Spring Boot MVC Application returns HTTP 404 when deployed to an external Tomcat/tc Server instance

I'm developing a simple application using Spring Boot plus Spring web starter. It goes very well when I'm testing with the embedded Tomcat server (JAR packaging). I need to debug some stuff so I thought it would be better to deploy it as a WAR on an…
Gustavo Ramos
  • 1,324
  • 1
  • 12
  • 23
8
votes
2 answers

Log4J2 configuration in 3.0 servlet

I tried to set up LOG4J according documentation (and related SO questions), but it does not create supposed file, but there is such log in WildFly: No Log4j context configuration provided. This is very unusual web.xml
Leos Literak
  • 8,805
  • 19
  • 81
  • 156
8
votes
1 answer

Difference between async servlet long poll and bayeux protocol (Comet)

What is the difference between a simple Async servlet and the Comet / Bayeux protocol? I am trying to implement a "Server Push" (or "Reverse Ajax") kind of webpage that will receive updates from the server as and when events occur on the server. So…
Basanth Roy
  • 6,272
  • 5
  • 25
  • 25
8
votes
1 answer

Is it possible to share the same MVC between external Jars and a War in Servlet 3.0 environment?

I understand that Servlet 3.0's enhancements have made it possible to display a .jsp from a .jar, based on Can I serve JSPs from inside a JAR in lib, or is there a workaround? However, I don't seem to be able to connect my View (jsp in jar…
Clement Martino
  • 463
  • 3
  • 17
7
votes
2 answers

Make use of web fragments (Servlet API 3.0) in a huge project environment

We recently migrated to Servlet API 3.0. Since we are developing a framework which sometimes needs a few changes in the web.xml, projects which are based on our framework need to update their web.xml whenever a change in the framework is…
Christopher Klewes
  • 11,181
  • 18
  • 74
  • 102
7
votes
2 answers

How to properly detect a client disconnect in servlet spec 3?

I have tried writing to the response, because there is no proper disconnect callback: private boolean write(byte[] output, AsyncContext context) { try { OutputStream stream = context.getResponse().getOutputStream(); …
OvdB
  • 121
  • 1
  • 10
7
votes
1 answer

Spring Boot still requires resource-ref in web.xml

Looking into Spring Boot right now and want to do it properly, as using Java config and ultimately without any web.xml. So, the tricky part is that the production environment requires a classic WAR file. Hence, I'm specified WAR packaging within my…
7
votes
1 answer

Error "Unable to process parts as no multi-part configuration has been provided" when uploading file

I am trying to upload an file via a form in a JSP file, but I'm getting this error. The servlet already has the @MultipartConfig notation. I'm using servlet 3.0 and apache tomcat 8. Error message: java.lang.IllegalStateException: Unable to process…
user3361891
  • 271
  • 1
  • 2
  • 6
7
votes
2 answers

JBoss 7 appends JSESSIONID to URL despite tracking-mode cookie

Yes, this is another "JSESSIONID in URL" question, but I haven't been able to find an answer. I'm running JBoss AS 7.1.1 Final and this is my web.xml:
Morten Jacobsen
  • 986
  • 1
  • 11
  • 31
7
votes
4 answers

How to specify mime-mapping using servlet 3.0 java config?

I am using Servlet 3.0 and looking to convert my existing web.xml file to java config. Configuring servlets/filters etc seems to be pretty straight away. I can't figure out how to convert the following mime-mapping. Can anyone help me…
user2145809
  • 571
  • 2
  • 6
  • 8