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

How do i ban a user from a spring web application effectively

I have built a single page webapplication using Angular on the frontend and Spring on the backend. Its a community website and i want to be able to ban misbehaving users the spring way. I have searched stackoverflow to see if there is a thread about…
Maurice
  • 6,698
  • 9
  • 47
  • 104
4
votes
2 answers

How to initialize a variable to accept any given class

I'm designing a jax-rs application. I need to have a common response object to every api call. This is the model of it. UserObject variable should be modified to accept any class that I set using get/set'ers. Currently it can only accept Customer…
sajithneyo
  • 641
  • 3
  • 7
  • 17
4
votes
0 answers

Spring Boot - Embedded Tomcat - @WebListener, scanned by @ServletComponentScan, adds a filter and gets java.lang.UnsupportedOperationException

Supposedly we can use @ServletComponentScan to add standard servlet components annotated with @WebListener, @WebFilter and so on. In my case I have a @WebListener that adds dynamically a filter: @WebListener public class FilterConfigurerListener…
codependent
  • 23,193
  • 31
  • 166
  • 308
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

Embedded jetty. java.lang.IllegalStateException: !STOPPED

I trying to make simple servlet in embedded jetty container. This is my jetty configuration: public class Application { public static void main(String[] args) throws Exception { //-Dport=8188 int port = 8188; …
Kirill
  • 1,540
  • 4
  • 18
  • 41
4
votes
1 answer

Can't Deploy Spring Boot EAR in JBoss 6.4 EAP

Edit Alright, so it looks like the SpringBootServletInitializer isn't detected because it's inside a JAR in the EAR, not the WAR. What I did was make a new module and included it in my WAR. This contained a META-INF directory with a services folder.…
Kenco
  • 683
  • 9
  • 21
4
votes
4 answers

How to set tomcat 8 container character encoding of request and response to UTF-8 intead of ISO-8859-1

We need to set tomcat 8 container character encoding of request and response to UTF-8 intead of ISO-8859-1 , What is the setting for the same We tried setting as mentioned below , https://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q1 But that…
Akshat
  • 575
  • 2
  • 12
  • 28
4
votes
1 answer

When we use AsyncContext mentioned in servlet3 specification, how long the http connection remains open?

When we use AsyncContext mentioned in servlet3 specification, how long do the http connection remains open? My piece of code is final AsyncContext asyncContext =…
4
votes
1 answer

How to set secure flag on cookie programatically

I know we can do something like this: true But what I want to achieve is to set this flag (true or false) based on some config. Should we use a filter and how ?…
kkung
  • 715
  • 4
  • 10
  • 18
4
votes
1 answer

Using a PreMatching filter to change uri path

In short, I have a Jersey REST service in a jar that I need to deploy in my webapp using mapping that differs from that which is defined in the annotations of the service. In the service, I have @ApplicationPath("/rest") and @Path("/foo"). …
Lucas
  • 14,227
  • 9
  • 74
  • 124
4
votes
3 answers

Web Services vs Servlets

I have whole business logic along with its integration to database written in Java. Now I have two options: either I can write a Restful webservice to access it or I can follow the standard servlet approach to access it from UI... What are the…
Jayant
  • 323
  • 3
  • 13
4
votes
1 answer

Should the HTTP client be changed for Asynchronous responses from the server?

Recently I have configured my Servlet for asynchronous processing with the below configuration true My question is, is this change transparent to the HTTP client? My client is not a web browser. It is a hardware…
TheMonkWhoSoldHisCode
  • 2,182
  • 3
  • 26
  • 40
4
votes
2 answers

How to set a default error page for WildFly server?

I'm using Wildlfy Application Server 8.2.0.Final. I have deployed an app.war file. In app's web.xml I can specify a home page and error pages. Which works perfectly for local-host.com/app url and for incorrect urls relative to it. When i type…
Ivan
  • 1,320
  • 16
  • 26
4
votes
3 answers

What is the Maven dependency for javax.servlet-api 3.1 implementation?

I'm using javax.servlet-api-3.1 version in my project. But as this is just an API specification I require an implementation jar. Please let me know the appropriate maven dependency for it. Note: Please note i'm using embedded jetty as my servlet…
geekprogrammer
  • 1,108
  • 1
  • 13
  • 39
4
votes
2 answers

Servlet 3.0 logout doesn't work

I've got a problem with the authentication features of Servlet 3.0: With this code in a Servlet v3: log.info(""+request.getUserPrincipal()); log.info(""+request.getAuthType()); log.info("===^==="); request.logout()…
Kevin
  • 4,618
  • 3
  • 38
  • 61