servlets

Can a HttpSession object be migraed from one VM to anoher VM?

Hi Can session object be migrated from one VM to another VM or It passivated in one VM and activated in other VM? How? ...

how to check session has been expired in java?

Is there any other way to check expiry of session other than this session.isNew() ...

Minimum Servlet API version for JAX-RS 1.1

What minimum version of the Servlet API is required to run JAX-RS 1.1 (for example Jersey 1.1)? ...

Using PrintWriter and OutputStream

Hello again! I am creating a project with struts and I have a problem using Jasper IReports. I want to export some info into a pdf file and I keep getting the java.lang.IllegalStateException: getOutputStream() has already been call... Exception due to openning a ServletOutputStream in my code when the page already opens a PrintWriter. ...

How to deploy a JAX-RS application?

The JAX-RS 1.1 specification says on page 6: If no Application subclass is present the added servlet MUST be named: javax.ws.rs.core.Application What is the added servlet? Could it be an arbitrary servlet? If an Application subclass is present and there is already a servlet defined that has a servlet initialization pa...

Difference between getHeader() and getIntHeader()?

Headers are always Strings. Even the getIntHeader() method always takes a String representing the name of the header; so what is the int about? ...

Better way to port Java into Python? (Hello World Servlet)

After several hours of working on porting this program over, it appears to finally be in a working state. However, I was wondering if anyone knew of a better way or more complete way of porting Java servlets over into Python. The beginning of the Python script contains a lot of support code to make it easier to port the program line-by-l...

is there any way to map a servlet to */

Hi, i want to map a servlet to URLs end with /. like /user/register/, /user/login/, but not any other resource under that path, not /*. i tried /*/, but it doesn't work. so please help, is there anyway to make / like end extension mapping. thanks. ...

how to config geronimo 'default' servlet

my site is structured as (in tomcat) blockquote /web/* blockquote /services/* where the web is all static content, html jpg, my web designer is using ftp to upload/edit the content of the /web/* /services/* is deployed as a .war file in tomcat i point the ftp user's root to /tomcat/webapp/web/ folder how to migrate to...

How to resolve StandardWrapperValve error on Catalina?

Hi I am creating a signup application with validation and Captcha (using SimpleCaptcha). I am able to deploy my application on localhost and everything works perfectly inclusive of the captcha. But when deployed the war file to a test server, my captcha is not working, and here's an output from the log file: org.apache.catalina.core.S...

Whats the best way to pass values from an html page to a java class?

Hello I have a project that needs to be changed.. right now i have a web page that posts to a jsp that calls a servlet that calls a "backend" using Tomcat. I need to get take Tomcat off the scene. What i want is when i POST, it calls directly the "backend" Any suggestions on how can i accomplished that? Thanks Rev ...

Tomcat not able to get ServletContext of another webapp

I am using tomcat 6 and I have two webapps. One is webapp1 and the other one is webapp2. From a filter inside webapp2, I am trying to access the other webapp i.e webapp1. My Filter code is something like below public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {...

Cluster aware servlet development

How can one develop a cluster-aware servlet and what is the design criteria for the same? ...

Servlet 3 issues with @WebFilter and @WebServlet deployment

I am trying to migrate my existing servlets and filters defined in web.xml file to @WebServlet and @WebFilter annotations on Glassfish V3 server. Currently web.xml defined 12 servlets and 6 filters . Tried removing one servlet from web.xml file and added @WebServlet annotation to Java servlet file . But having difficulty in accessing t...

What is the difference between JSF, Servlet and JSP?

Is JSP = Servlet? And JSF = Pre-build UI based JSP (like asp.net web control)? ...

Java Servlets threading model

I was wondering if anybody could explains me the threading model of Java Servlets? As I understood about that, there is only one instance of a servlet can be existed in the servlet container and if muliple threads happens to be waiting for that servlet, there requests are serialized in some manner. I don't know how that serialization pr...

How can I find the encoding of a FileItemStream returned by FileItemIterator?

I use Apache Commons FileUpload to receive uploaded files in a Servlet, as described at http://code.google.com/appengine/kb/java.html#fileforms ServletFileUpload upload = new ServletFileUpload(); FileItemIterator iterator = upload.getItemIterator(request); while (iterator.hasNext()) { FileItemStream...

Servlet post request logging to Eclipse console

I'm writing my first JEE application, using EJBs, Servlet, JSPs and the likes. I'm using JBOSS 4.2 AS and Eclipse as and IDE, including tasks like starting and stopping the server. What I can't understand is that while logging instructions inside a jsp, like: <% System.out.println("Log this!"); %> log as expected, both in Eclipse c...

how to add data in cookie

I want to add two values in cookie and retrieve them. I am doing in this way, but I am getting only the first value, not the second. Cookie c = new Cookie("a", a); c.setMaxAge(60); response.addCookie(c); Cookie b = new Cookie("d", d); b.setMaxAge(5 * 60); response.addCookie(b); While reading: Cookie cookies[] = getRequest().getCooki...

preserve search criteria in jsp page

I have a JSP page which display a list from servlet, it has a textbox which is used to filter the search result. I am selecting a item in the list (table) and redirecting to another page for editing the details after finishing the editing. I am able to come back to the search page via servlet, but I am unable to preserve the search condi...