servlets

Want to send mail after specific time in Java

Hi Guys I want to send mail after specific time Actually I want to send mail after 23 hour from the specific date Now I am using java.util.TimerTask Thread to call that email function Please help me.. Thanks ...

Monitoring DB: MySQL

Hi, I am writing to ask for advice. I have to monitor certain "insert" on a mysql db. In what way is more convenient to do this? The application uses Servlets and MySQL. Thank you very much ...

Templates with Facelets and calling action from template's component ?

Hello everyone ! I'm a newbie in JSF, facelet, richfaces... and I understood managed beans, methods called within JSF components However, I wanted to use facelets template with the ui:composition, ui:define, like master pages in asp.net But I have an action that's meant to be called in a masterpage component... and I keep having the s...

config files for a webapplication - load once and store where?

I have a bunch of properties (configurations) that can change per environment. However these values do not change once the web application is deployed.So consider that there is an application.properties file that I want to read lots of times during normal program flow. I know that I can probably load these at server startup time. Howeve...

Tomcat servlet logging

I'm new to Servlet containers and have created a web application using Tomcat 6.0.26. I have 'TODO: log' scattered throughout my code. I see there exists: myServlet.getServletContext().log() which appears to write to a file prefixed with 'localhost' in the Tomcat '/logs' directory. I don't need any advanced logging capability, but I...

Concurrency in Java EE application

Hi all, Previously I asked this question: http://stackoverflow.com/questions/2941657/read-quicktime-movie-from-servlet-in-a-webpage Basically I used a servlet to stream a movie file to a quicktime plugin on browser (In order to play file outside the root). At the end Ryan Fernandes asked me the question regarding concurrency issue. I ...

request.getQueryString() should not be null?

I'm debugging an old Struts 1.2 w/ Tiles application running on Oracle App Server 10.1.3. There are some scenarios in which request.getQueryString() seems to improperly return null and it seems to have started doing this without any changes to the application code, indicating that server patching may be a factor. I added some scriptlet c...

Processing XML data for JSP

I have a form/calculator, which posts to itself some data, this data is then calculated by dispatching a servlet and the results are output as xml. The dispatcher code is shown below: //create instance ServletContext sc = this.getServletContext(); //create dispatcher RequestDispatcher rd = sc.getRequestDispatcher("/ProCalcServlet"); rd...

GlassFish 2.1.1 - TopLink (JPA1) Persistence Exception 7106 - String Encryption Mistery...

I'm using NetBeans 6.8 and Glassfish Enterprise Server 2.1.1 ((v2.1 Patch06)(9.1_02 Patch12)) (build b31g-fcs). I created a servlet and used Netbeans code generation features to imlement persistence using TopLink (JPA1). When I try to create an Entity Manager with the following code: EntityManagerFactory entityManagerFactory=Persiste...

Calling a Remote Java Servlet

I have a jsp page which holds a form, it is supposed to send off the form data to a remote servlet, which calculates it, and then returns it as XML. It works, but at the moment I'm creating an instance and dispatcher which only works with local servlets whereas I want it to work with a remote servlet. I was previously told that HTTPClie...

How to redirect browser from POST request to GET a new location? servlet

I'm using GAE with Java servlets. I have a form POST request, and I have to redirect the browser to a new location with GET method. How can I do this? ...

Servlet filters - passing an attribute not working with RequestDispatcher#forward

Hi, I'm trying to set up a site which allows users to create their own page - as a subdomain of the site, and so what I'm currently trying to do is to have a filter which looks at the subdomain, and if it's not in use, or if it's reserved, then the user will be forwarded to a page where they choose their subdomain name. The problem that...

How to get download csv file using java servlet ?

Hi, I have sample java servlet file.but it is export to local file.But i need to download the csv file when the hit download button ? here is servlet class , what code i need to add here for download the csv file ? import java.io.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; public class CsvFile extends Ht...

Quick JSP/Servlet article/book/tutorial

Hi gangs, I am just asking about a very quick book/article (about 100-200 pages) about JSP/Servelts that the one that already knows JSP/Servlet can use to refresh it's knowledge in short time (1 day or so). It is better to be a free book/tutorial. Thanks in advance. ...

Pass array from my application to JS

Hi, I am developing an application in JSPs and Servlets, and I want to know if, and how it is possible to pass an array from my application in to some javascript so that i can use the Autocomplete feature from the jquery ui library. Thanks in Advance Dean ...

Guice servlet DSL, filter all but one URL

I want to filter all requests to my web application through my "SecurityFilter" which checks that a session variable "authToken" is valid. The problem is that in order to get this token you need to hit the "AuthServlet" which is at /auth. I need to filter all servlets except the /auth servlet with my "SecurityFilter". How can I do thi...

Spring session-scoped beans (controllers) and references to services, in terms of serialization

a standard case - you have a controller (@Controller) with @Scope("session"). classes put in the session usually are expected to implement Serializable so that they can be stored physically in case the server is restarted, for example If the controller implements Serializable, this means all Services (other spring beans) it is referring...

GWT RPC: Use same DB connection across multiple requests

I'm working on a web front-end to a database. The purpose is to create a tool that students can use to learn SQL, issue queries, and see the results. Prior to now I've been using the CLI. Its primary disadvantages are a) students these days are more used to GUIs; and b) when the query returns a very wide table, it's hard to read because ...

Resolve EL variables in Javascript with FacesServlet

I was externalizing in a file all my Javascript code inside and application, and to resolve all the EL variables inside the code I tried to use BalusC solution 2 proposed as an answer to this SO question. I am trying to use the Faces Servlet to handle JS files when requested. The problem comes that when I set up so, the JS file is not ...

Apache commons fileupload FileItemIterator hasNext() returns false

Hi all, I'm using the apache commons fileupload stream api. But the FileItemIterator FileItemIterator iter = upload.getItemIterator(request); returns false in its hasNext() iter.hasNext() What is wrong with this? The code and the web part is as follows: protected void doPost(HttpServletRequest request, HttpServletResponse response) ...