servlet-3.0

Does ServletContext.getRealPath() work with web fragments?

孤者浪人 提交于 2019-12-12 05:33:35
问题 I use web fragments (servlet 3 spec) and thus can load e.g. META-INF/resources/access.xml file which is in a library in /WEB-INF/lib/ of my WAR via ServletContext.getResourceAsStream("access.xml") . Doing the same with ServletContext.getRealPath("access.xml") doesn't work (=> null ). The spec states: The getRealPath method takes a String argument and returns a String representation of a file on the local file system to which a path corresponds. Resources inside the META-INF/resources

Servlet 3.0 doesn't load on application startup

天大地大妈咪最大 提交于 2019-12-12 03:57:35
问题 I've a JSF 2.0 web application running in tomcat 7.0.29 and tried to use the Servlet 3.0 annotation but the servlet didn't work as i can't see the log written in its init() method. i ve read many answers for the same problem but still not seccessful. This how my files look: The web.xml : <?xml version="1.0" encoding="UTF-8"?> <web-app metadata-complete="false" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun

In Grails 3.2.4, controller that has an .async.task call in it sets request.asyncStarted() to true but doesn't render response

假装没事ソ 提交于 2019-12-12 02:18:57
问题 First off, this wasn't an issue in Grails 2.5.4. I'm making an angular AJAX call to my Grails controller and the Grails controller is never responding. The front end call looks something like this.. $http({ method: "GET", url: actionLink, params: {} }).then(function successCallback(response) { console.log("Yaaay, I got back with some sort of response"); }, function errorCallback(response) { console.log("ERROR PULLING DETAIL") }); I've confirmed that AJAX calls to other controllers that don't

CXF Servlet Java config redirect to index.html

冷暖自知 提交于 2019-12-11 12:38:50
问题 I'm trying to configure CXF entirely through java config, everything is working fine except the static-welcome-file init parameter. Here is my code: @Bean public ServletRegistrationBean cxfServlet() { ServletRegistrationBean registrationBean = new ServletRegistrationBean(new CXFServlet(),"/service/*"); registrationBean.setLoadOnStartup(1); //Allows static resources to be returned Map<String, String> initParams = new HashMap<>(); initParams.put("static-resources-list", "/app/.*"); initParams

Spring boot: Start an application automatically when Webshere Application Server starts?

微笑、不失礼 提交于 2019-12-11 04:59:00
问题 Assume I have a SpringBoot Application deployed as a WAR to Websphere Application Server (WAS). This WAR contains a daemon, so it must start straight away when WAS starts (and only once). However, I still need to activate the SpringBoot Servlet by doing a http request. Now I understand that the concept of servlets is to act on http requests, I still want to get it auto started on appserver start. This makes my daemon portable from standalone jar/main to war/webapp. I tried a

FacesServlet Servlet 3.0 Async Support

柔情痞子 提交于 2019-12-11 04:39:10
问题 Does the FacesServlet in JSF 2.0 support the servlet 3.0 async features? 回答1: No, with the simple reason that JSF 2.0 is designed with Servlet 2.5 in mind. JSF 2.1 in turn is however designed with Servlet 3.0 in mind, but it does not utilize the new async features, perhaps with the simple reason being that there's just no need for it. The closest what you can get is ajax poll/push provided by 3rd party component libraries like RichFaces, PrimeFaces or IceFaces. 来源: https://stackoverflow.com

Resuming a javax.servlet.Filter filter chain after an async timeout when using spring

自闭症网瘾萝莉.ら 提交于 2019-12-11 04:29:31
问题 I would like to add a delay to some requests without holding onto a thread under jetty. I think this can be done using the asynchronous support added to servlet 3. I have inside of my filter, which is the first filter to run, something that adds the delay: AsyncContext asyncContext = request.startAsync(); asyncContext.setTimeout(1000L); that appears to delay the request but I am not sure how to to resume the filter chain. I would like to resume the filter chain when the timeout times out. I

Why is there no asyncContext.cancel()

无人久伴 提交于 2019-12-11 04:24:29
问题 While the Servlet 3.0 spec has request.startAsync() and asyncContext.start() , why has it not provided a asyncContext.stop() or asyncContext.cancel() to initiate necessary clean-up on the server-side ? Pls view this in the context of this other question to understand where I am coming from. One HTTP request starts the Async processing and returns a .../outstandingRequests/requestId link to the client. Another HTTP request calls DELETE on that link to cancel the request In this case, if I had

NoSuchMethodError HttpServletRequest.getServletContext() on Servlet >3.0

若如初见. 提交于 2019-12-11 03:33:48
问题 I'm trying to set up a WebSocketServlet in Jetty. I've set up a servlet according to this guide, and implemented the WebSocket according to this one. However, when I run gradle jettyRun and attempt to open a connection (using this) to ws://localhost:8080/myProjectName/echo ), I get java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getServletContext() (full stacktrace) I see that this method was only introduced in servlet 3.0 - however, since I'm using servlet-api:3.1.0 , I

Access file inside WebContent from servlet

▼魔方 西西 提交于 2019-12-10 15:53:15
问题 I trying to access the html files inside the WebContent/alerts folder using its relative path from servlet. But i unable to access it using its relative path, Access the file inside WebContent from Servlet using relative path: protected Element getSummary(String value) throws IOException { Element element=null; Summary summary = Summary.valueOf(value); switch(summary) { case rtp_summary: element=parseDIV(new File("../../WebContent/alerts/rtp_bcklg_mail.html"),"rtp_summary"); break; case ffu