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

Redirect servlet async and heart beat

We have tasks in java web-app that take a long time in completing and before the time the task completes the request times out and page cannot be displayed happens. We are think of setting a async redirection servlet that acts as a front-controller…
Siva VG
  • 45
  • 1
  • 9
0
votes
0 answers

java.io.IOException: The filename, directory name, or volume label syntax is incorrect Error while writing to HTTP directory

`I am writing a java code to upload files in HTTP server using JSF 2.0 wtih Servlet 3.0. When i am trying to uplaod the file to local system it works fine but if I specify the HTTP server url directory in http_path variable it gives…
SJUmbarkar
  • 3
  • 1
  • 5
0
votes
2 answers

Could we have path variables mapping without spring mvc?

I was wondering if it's possible to map path variables within a regular java servlet 3.0 in a similar fashion we can do with Spring MVC and its annotation @PathVariable. I want to be able to retrieve params in url like this…
blackjack
  • 1,081
  • 2
  • 13
  • 30
0
votes
1 answer

Csv file to MySQL database table

Fix the error and i need to import(store) csv files to mysql database table Class.forName("com.mysql.jdbc.Driver"); java.sql.Connection c = null; c = DriverManager.getConnection("jdbc:mysql://localhost:3306/Sample", "root", "root"); …
Kannan
  • 49
  • 1
  • 3
  • 9
0
votes
3 answers

Java Servlet API: Remove GET parameters from URL

Is there anyway to remove the GET parameters from the request URL? Such that when the response arrives to the client, the window's location will be a URL clean from GET parameters. Is there anyway to do this without doing any redirects and that the…
Ram
  • 1,016
  • 4
  • 15
  • 25
0
votes
1 answer

Get file in JAR using Servlet 3.0 Tomcat

Servlet 3.0 has a great feature: I can access static resources in JARs using the META-INF/resources folder. So if I have a javascript inside my JAR I can access using http://myurl.com/myapp/myjavascript.js. That's great. But... How to to get that…
Nestor Hernandez Loli
  • 1,412
  • 3
  • 21
  • 26
0
votes
1 answer

Servlet 3.0 HTTP 404 - The requested resource is not available

I am getting error HTTP Status 404 - /WebServlet3.0/ type Status report message /WebServlet3.0/ description The requested resource is not available. Apache Tomcat/7.0.42 This is my ServletAsync.java file, which is under a src ->…
0
votes
1 answer

Obtaining name of uploaded image with servlet 3.0

Hello i am making a servlet that gets the image from a Everything in my servlet works fine. The only problem is that i want to know what is the name of the uploaded image so that i can store its full path in a database. How to i so that? This is…
0
votes
2 answers

jsf IllegalStateException on redirect even with return

In my preRenderView invoked method some validations are performed and if it fails a redirect shall happen. But i am getting an IllegalStateException Information: Exception when handling error trying to reset the…
djmj
  • 5,579
  • 5
  • 54
  • 92
0
votes
0 answers

How to disable caching of jsp (and static resources) at META-INF/resources in Tomcat 7 (servlet 3.0)?

I've tried to set the cachingAllowed to false at both context.xml and server.xml. And I use the default Context (org.apache.catalina.core.StandardContext). But Tomcat still ignores modifications in dependencies jars within WEB-INF/lib (changes in…
0
votes
2 answers

request.getParameter(String param) bug?

getQueryString() gives cid=1¶ms=zDmrLGXJ1DboOuqBn2062Z%2BQmQ4w7ODNGAfZL4L8rpk%3D. and getParameter(PARAM_NAME) gives zDmrLGXJ1DboOuqBn2062Z+QmQ4w7ODNGAfZL4L8rpk= What happened with %3D. ? I used URLEncoder.encode(url, "UTF-8") to create…
Damian
  • 2,930
  • 6
  • 39
  • 61
0
votes
2 answers

Reading nested name-value pair in Servlet

I need to read the HTTP POST request data in servlet. Data is in name-value pair. Following is the data sent to server ( I picked this data from Network tab in google chrome's Inspect Element…
Kanishka Gupta
  • 217
  • 2
  • 6
  • 17
0
votes
1 answer

Uploading and handling a file to a servlet from another application/service

This really is two questions in one since they are both faces of the same coin :) ... 1) How can I upload a file to a servlet from an application/service, in other words without a html form that a user should fill in? 2) On the receiving end, I have…
0
votes
1 answer

how to output when we implement a Servlet interface

I have just started learning servlets: As far as i know, we can create servlet in 3 ways: By writing a class that extends HttpServlet By writing a class that extends GenericServlet By directly implementing Servlet interface (is this correct?) I…
user1788048
  • 265
  • 1
  • 8
  • 18
0
votes
0 answers

Embedded Tomcat 7 does not found ServletContainerInitializer from servlet-api 3.x

I'm using the embedded Tomcat 7.0.40 for my unit tests. My webapp uses Servlet 3.x (with x>0). I managed to deploy my webapp on the Tomcat. // create the embedded Tomcat Tomcat tomcat = new Tomcat(); // (...) // deploy the WAR in the webApp…