servlets

How do I create an HTML table of files for download?

I'm in charge of updating an existing java app for an embedded device (a copier). One of the things I want to do is create a servlet which allows the download of all the files in our sandboxed directory on the device (which will include the application log files, local caches, etc). At the moment these files are all in a single director...

Constructing a DataSource from an InputStream or Byte array

I am writing a small file upload utility thing as part of a larger project. Originally I was handling this from a servlet using the Apache commons File utility classes. Here is a snippet from a quick test client I wrote for the service: public static void main(String[] args) { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean...

How to scrape images from a web site with javascript and servlets

I have a web page that has the following content (I've changed the URL in the src tag for privacy purposes, otherwise viewing the page source is identical): <HTML> <BODY> <script type="text/javascript" src="http://localhost/servlet?publicKey=abcdefg12345678&amp;amp"&gt;&lt;/script&gt; </BODY> </HTML> The resulting page displays an i...

Select drop down value retrieval

Hi All, I have the following data <select class="small" name="test"><option value="1">a</option> i want to print 'a' how can i do it? request.getparameter(test) gives me the selected value like 1 ...

too much information in HttpSession

Hi what do you think about this problem? We do have too much information in HttpSession, because much information is computed and a few large graph of objects are needed to store between requests finally. Is it appropriate to use any cache like memcache or so? Or is it the same as increasing memory for JVM? There's fear of storing it ...

handling forms with mutliple buttons / posts

I have the following form setup: <html> <head></head> <body> <form method="post" enctype="multipart/form-data" action="FileUpload"> <table> <th>WEX SI Online Validation</th> <tr> <td>Step 1: Select File for Validation: </td> <td><input name="filename" type="file"/></td> </tr> ...

Redirecting Facebook 'offline_access' permission page

I am trying to get users' permission for 'offline_access' in an iFrame Facebook application coded with the Facebook Java API. I understand that I need to obtain an 'indefinite session key' after the users approves my application. Currently, I can accomplish what I want, but in a very awkward way that is probably not correct. There must b...

how to get Updated data using same Httpservice in flex

I have a flex form which has two httpservice.one which accesses data from the servlet and one which stores data into another servlet. Firstly when im accessing the data from the servlet that is working and the storing part is also working..so when i again call the access servlet im not getting the updated display..the access servlet is n...

Can I change web application root globally in jboss 4.2?

Hi, I have following situation of deployment: application_one.war application_two.war application_three.war When I deploy it in Jboss, I get three url contexts: http//myserver/application_one/ http//myserver/application_two/ http//myserver/application_three/ Is it possible to change (prepend) globally an additional path to all d...

where to place properties files in a jsp servlet web application

In my web application I have to send email to set of predefined users like [email protected], so I wish to add that to a .properties file and access it when required. Is this a correct procedure, if so then where should I place this file, I am using Netbeans IDE which is having two separate folders for source and JSP files, advice solicite...

Asynchronous Servlets vs. synchronous Servlets

Since Servlet 3.0 asynchronous processing is supported. Would it be better, to use always asynchronous processing? Or in what cases is synchronous processing better? ...

How to dynamically update date and time in flex from the server?

I have a GUI in flex. I am getting the value of the server date from the servlet to the .mxml file. I want to show the date and time dynamically changing. How can I do that in flex? ...

How can recognize user selected which ones?

Hi, I have two list on my request on jsp. First one is productGroupName, and the second is products. Now, I show these like below. <html:form action="/priceOrder"> <table width="100%" id="tableStyle" style="font: message-box;padding: 20px;"> <logic:iterate id="productGroups" name="productGroup"> <tr> <td> ...

Is there any other way of servlet instance get created?

Hi I like to know is there any other way servlet instance get created. One way is when client makes a first request to the servlet. Thanks ...

Does servlet not have any extensions?

Hi I like to know like whenever user requests a jsp page we write hello.jsp or any html file we write hello.html or any image hello.jpeg. My question is does servlet not have any extension ? Is it called directly called by name? ...

facebook-java-api: fql_query returns null

Hiya. I'm trying to fetch logged-in first name using fql_query. i tried the following code: import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import javax.servlet.http.*; import javax.servlet.*; import org.w3c.dom.Document; import com.google.code.facebookapi.FacebookException; import com.google.code.f...

MD5 Signing a HttpServletResponse

I'm looking for a way to inspect the contents of a HttpServletResponse to sign them with a MD5 hash. The pseudocode might look like this process(Response response, Request request){ defaultProcessingFor(response,request); dispatcher.handle(response,request); // Here I want to read the contents of the Response object (now filled wit...

MUlti Language support in JSP/Servlet

How to provide multi language support through JSP/Servlet? How to include static data of different languages at run time on basis of language selected? ...

Ajax refresh problem after the file is export ?

I want to refresh the particular div after the file download page appear. I have tried both synchronous and asynchronous way of ajax call. but It refresh the page before the file download page appear. I am writting the file download using servlet response stream. Is there any way to refresh the page after the file download page appear. I...

Difference each instance of servlet and each thread of servlet in servlets?

Hi I am confused .. Are there multiple instances of servlet class? As I hear "each instance of servlet" Can anybody elaborate on this? ...