servlets

Calling other servlet methods from JSP

I am making a servlet program. It is working fine, but now I am trying to make a method other than doGet or doPost that get called from JSP. Is it possible? ...

java servlet: difference between send redirect and forward in servlets

I am using servlet there is two method redirect and forward both are send request to the same page but what is the difference between them.any idea ...

How to get the file name for <input type="file" in jsp

I want to read the file path from html input type="file" (the entry selected in the file dialog by the user) <script> function OpenFileDialog(form) { var a = document.getElementById("inputfile").click(); SampleForm.filePath.value = //set the path here document.SampleForm.submit(); } </script> ...

Servlets stats using wsadmin

Is there a way to probe the stats of servlets using wsadmin according to this MBean interface? http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.javadoc.doc/web/mbeanDocs/index.html For example, the names of the servlets, the URIs, etc ...

Using <input type=file /> with J2EE/MySQL Backend

Hey everyone, I'm wondering how I can hook up an input type=file to send a picture back to a backend servlet that will eventually be stored in a MySQL database as a BLOB? In other words, how can I upload a picture using the input and send that back to the servlet to insert into the database as a BLOB type? Thanks ...

display next records by pressing next

I have a website in front page. I'm displaying 5 records. I want that when user clicks Next, he should be able to view next records. I want to keep track which sublist has already been shown to user. I am using an ArrayList. How to get next records each time user clicks on next button, using servlets? ...

PWC1406: Servlet.service() threw exception java.io.IOException: Invalid chunk header When client send data to server

I am developing an application using J2ME to send the GPS coordinates received to the server and i am new to developing client server application. Everything works fine with the use of Nokia N97mini or E71. But when i tried it on HTC HD2, i get the exception from the server. I am using Netbeans 6.5.1 GlassFish V2 as Server. I have no id...

EOFException in ObjectInputStream Only happens with Webstart not by java(w).exe ?!

Hi, Anyone familiar with the differences in starting with Webstart(javaws.exe) compared to starting the app. using java.exe or javaw.exe regarding streams ? This is the exception which i ONLY get when using Webstart : java.io.EOFException at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source) at java.io.Object...

How to switch easily between ajax-based website and basic HTML website?

Hi, I have a website ( based on JSP/Servlets ,using MVC pattern), and I want to support AJAX-based website and basic HTML-based website. website visitors should be able to change the surfing mode from Ajax to basic HTML and vise versa, - as it applies in Google-mail. The Questions : What is the best way to achieve this goal easily? Sh...

Variable 'app' in url-pattern for servlet mapping

I'm learning Spring MVC (and servlets in general) and following springsource's mvc-ajax example, which uses annotated controller methods. It appears that there is only one url-pattern (in web.xml) mapped to a servlet in that example: /app/* I've deployed the app as a WAR file, and the actual, ugly URL I'm requesting is http://127.0.0.1...

Mapping to a JSON method with url-pattern

I'm creating a Spring MVC application that will have a controller with 'RequestMapping'-annotated methods, including a JSON method. It currently has static content that resides in webapps/static, and the app itself resides in webapps/myapp. I assume that Catalina's default servlet is handling the static content, and my *.htm url-pattern ...

Strange values coming from HttpServletRequest.getReader

I built a restful ajax app using Java and servlets. When making POST requests, I send json in the body, but when making GET requests, I rely solely on the URL. While testing, I made it so that the app gets the raw request body using HttpServletRequest.getReader on each request, no matter what. What I found was that extremely rarely and s...

Simple servlet or filter to process form

Is there a simple framework for processing form submissions via a servlet? For my needs, a framework like STRUTS seems like over kill. My ideal processor would be a servlet that converts form elements into a bean object, possibly using typing information in the form to help with the conversion. Does something like this exist or is ther...

Java Logger with Servlets

Hi Guys, I am using a wrapper class A which initializes the java.util.logger static class A { public static Logger logger; public static void init(){ logger = Logger.getLogger("test"); } Now, everywhere in my program I call A.init() and then logger.log("Message+uniqid"). But recently I moved to HTTP servlets and I am...

java tomcat: what library should i use to convert images to jpg and create thumbnails on-the-fly?

Hello. I have a form that accepts image file, i want to be able to convert this image from any common format to jpg and to create a thumbnail. what's the recommended method to achieve such a thing? Working with latest apache-tomcat on a gentoo linux server. thanks ...

Why can't I wrap the ServletRequest when trying to capture JSP output

I am trying to dispatch in a servlet request handler to the JSP processor and capture the content of it. I am providing wrapper instances for the ServletRequest and ServletResponse, they implement the corresponding HTTPServletRequest/-Response interfaces, so they should be drop-in replacements. All methods are currently passed to the or...

unable to implement HTTP Tunneling correctly in order to enable Java rmi calls over internet(and under ISP)

in my previous question :-How to Setup RMI Server under(NAT/ISP) Now,i m able to start my RMI server by Installing apache Tomcat 6.0 server. i have also installed servlet programs into apache Tomcat server in order to enable HTTP tunneling. my servlet codes:- (1) [SimplifiedServletHandler.java][2] (2) [ServletForwar...

How to add resource files during build on J2ee (eclipse + jboss)

hi, i'm trying to run a web servlet project in eclipse 3.4 using jboss 4.2.2 as my web server. im using the wtp plugin and everything looks good (can run and debug). but some of the files/resources are not included on the war file. in my "WebContent/WEB-INF" folder, i have "properries", "config", and "lib" folders. but it seems like w...

Calling a GWT service in a different context than the GWT Module Base?

I have a GWT module with the X-GWT-Module-Base http://host:8080/foo/ and would like to call a (GWT) service which is located at http://host:8080/bar/. The reason is for example that I want to be able to share a GWT service between two different GWT client projects. All I've gotten to work so far is if the service is located within the m...

Reading greek text from jdbc / SQL Server 2005 and displaying it with a servlet

Well, the subject says it all but I will explain a little further. I have a database in MS SQL server 2005 that contains greek text. I have created a servlet that connects to that database using net.sourceforge.jtds.jdbc.Driver and receive some data with the following commands: Connection con = DriverManager.getConnection(connectionUr...