servlets

uses of sessions & cookies?

what is use of sessions & cookies in servlets? ...

Are Java web frameworks really worth the hassle?

I'm relatively new to Java programming (About 2 years) but not to web development. I started out with HTML and ASP (pre .NET), and have recently started messing with J2EE. I feel like I have a good grasp of JSP/Servlets (I find them to be similar to ASP) and have recently begun working with JSF and Facelets. Although I can see why peo...

Product browse in Java Servlets

Hi! I am creating a web application using EJBs and servlets. I have a page which displays a list of all items in the database. I would like to provide an option for the user to click on one of these items and this opens the SHOW servlet which gathers info regarding the item onto the page. I do not want to create a page for every single i...

How to use the "application" object in a Servlet?

If we are coding a JSP file, we just need to use the embedded "application" object. But how to use it in a Servlet? ...

Container-managed EntityManager in Servlet

How to obtain? ...

How to take previous value during refresh of a servlet

I hava a servelt. I am using the following code to refresh. res.addHeader("Refresh", "10"); But before I am reading the date using a form. For the first time, it works fine. But after 10 sec, during refresh I am getting null pointer exception as date is null. How to take the previous value of date even after refresh. thanks in adva...

How can I best initialize constants from a database or servlet context?

We have constants declared in an interface in our application like this. public interface IConstants { public static final String FEVER="6"; public static final String HEADACHE="8"; } We now want to populate these constants values (6 and 8) from the database (or application servlet context). The database values stored in a lo...

Running multiple web frameworks on one machine?

I want to start experimenting with all these different web frameworks that are available. I was wondering if they could all run in one machine at the same time? I know that all my database services can all run at the same time, along with the Javascript frameworks, but what about something like Rails and Java applications? Can those pl...

How to learn AJAX using jQuery in a Java web app

Can someone point me to tutorials using jQuery to create AJAX apps with Java (servlets). I was looking at the tutorial Implementing Ajax in Java web application using JQuery, which is similar to what I need, but it doesn't include most of the detail. If you know of a good tutorial, text + graphics or video or know the main steps and can...

jQuery is adding servlet name twice to URL

I am trying to complete the tutorial at http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=438 It seems that the servlet is trying to POST the data to http://localhost:8080/WeatherServlet/WeatherServlet ... (WeatherServlet is the name of the servlet - duh). I have the following index.jsp page (which displays fine) <%@ page l...

How do I repopulate a form using Java?

I have a form that is submitting to a servlet and processed with the doPost() method. Once the form is submitted, the user is taken to another page with a "Back" button (not the browser's back button). If the Back button is clicked, the form should repopulate with the original input. How can I accomplish this? ...

Getting the real (virtual) host name under an application server

I have an application running under Jetty, and I want the application to return self referencing absolute URLs (when generating an RSS feed, so a client must be able to work without a "current URL" context). The problem is that I don't know ahead of time under which host name the application will be deployed, and it is quite likely tha...

Is there any way to inject custom controls into JSPs using a servlet?

I am new to JSPs and Servlets - I am wondering if there is any way for a JSP of delegating to a servlet the generation of given areas of the page such as custom controls (AWT stuff and such). The reason why I am looking into this is that JSP pages can get really messy really fast. Examples appreciated! ...

Problem running a servlet.

I'm seeing a problem while attempting to run a java servlet under eclipse (Ganymede), I'm running Java 1.6 and Apache Tomcat 6.0. Here is what i am doing: Stop Tomcat. New Dynamic webproject. Call the project TestProject Use default options: Context = "TestProject", Context Directory = "WebContent", Java Source Directory = "src" Right...

refresh option is servlet

Hi, I am having the below code in a servlet. I wnat these lines of code to refresh every 30 seconds automatically. I dont want the other code that is present in servlet to refresh out.println(""); out.println(""); out.println(""); out.println("<frame src= \"unlock.html\">");...

File download servlet behaving differently with IE on clustered server

I have a servlet that sends a file by setting the HTTP Content-Type to "application/zip", the Content-Disposition to "attachment" and writing it on the response's OutputStream; it behaves correctly when deployed on my local application server, making the browser show the popup to choose wheter or not to download the file. However, when ...

How to create Java Custom Web Controls?

This question was originary in my head as "Can I use AWT controls in a Servlet?", which will show all my ignorance on the subject. I am new to JAVA technologies but after a bit of reading, I seem to understand AWT controls directly hook up the OS GUI elements so there is no way to use or extend JPanels, JButtons and so forth in a Servl...

Disable all default HTTP error response content in Tomcat

By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via web.xml an <error-page> can be configured to customize this content. However, I'd just like for Tomcat to not send anything in terms of response content (I'd still like the status code, of course). Is there any way ...

How to maintain confidentiality of transformed media in two-host configuration?

Let's say I have two machines, A and B, on the public internet (not an intranet). Machine A has a web server that hosts unencrypted images of confidential documents. Machine B hosts an ASP.net or Java servlet page for allowing manipulations of those images. The URL of media on Machine A can be passed to the page on Machine B, which ca...

What's the best way to deploy an image servlet to maintain confidentiality of images?

I have a servlet for allowing manipulations of images - zoom, etc. What's the best way to deploy this service so that the users of the servlet keep their images confidential? I assume this means they need to run the servlet on their own servers rather than on mine. Is there any other way of providing this service to them? ...