servlets

Passing request object to different servlet/action of same application running at different servers

Hi I have one application running on different servers build in struts2 and deployed in Tomcat5. Now I have a functionality of "Save on All" in this application. When it is called, then the same request parameters need to be passed to all the servlet/action of all the applications running in all the servers. How can this be done? E.g....

Java SessionID: How to get the Name of the GET SessionID Parameter?

Hello, it seems that the Parameter-Name in the GET request, that represents the SessionID (like jsessionid=XXXXXXXXXXXXXXXXXXXXXXXXXX in Tomcat) is not standardized in the servlet-spec? How can I get the (Servelt Container Specific) name of the SessionID? (At least in Websphere there seems to be the possibilty to change the name of the ...

AJAX (prototype/java) getting partial status updates during execution

This partially mimics AJAX (prototype/php) getting partial status updates during script execution, however I'm working with JSP pages and servlets. What I want to do is start an action when the user clicks a button and then present updates on the progress of this action. The action can take anywhere from 1 to 10 minutes to complete, so I...

Applet v/s Servlet

Whats the difference between Applet and Servlet in JAVA ...

pass ResultSet from servlet to JSP

Hi I am doing the following in my SampleServlet.java //Fill resultset from db ..... try { ArrayList Rows = new ArrayList(); while (resultSet.next()){ ArrayList row = new ArrayList(); for (int i = 1; i <= 7 ; i++){ row.add(resultSet.getString(i)); } Rows.add(row); } reques...

Fire off an internal ServletRequest in Tomcat

I am using Quartz to schedule background tasks for a web application. Some of these tasks just fire off requests against the same web application. I want to avoid depending on any kind of network settings (for example a request with my own domain name might not be routed properly if made from within the data center). Is there a Java API...

Is it possible to use a JSP as a template for a servlet?

I've been intermixing JSPs and Servlets in the web app I'm building and I'm starting to find that my more complex JSPs end up containing a lot of code, which flies in the face of all the MVC lessons that have been pounded into me. I know I can do this by just forwarding to the JSP, but this seems like a stupid hack. What I'd like to do...

How to configure routing for a java web app

Is there an easy way to rout all requests (except a few specific cases) for url "mysite/" to path "mysite/index.html?" Is it possible to do it only by editing web.xml file? ...

Can't access locally hosted project via the internet?

I'm currently developing a Java Servlet Project in Eclipse. The project is compiled via Tomcat 5.5 and hosted in localhost:8080(alternatively 127.0.0.1:8080 AND 192.168.1.10:8080 which also happens to be my local IP). The hosted project can be accessed on another computer via my Intranet(Local Network) at 192.168.1.10:8080. It should be...

Error with Web Service reference in NetBeans 6.7.1

I have created a java web project to make a servlet. However, it used to work fine before i reinstalled it. the Web Service reference doesnt not show the operations and gives the following error: javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found at javax.xml.parsers.Doc...

How do I trigger a servlet method on page load

I have entries in a text file which I want to load into a drop down box. I want this to happen on loading a jsp page. I could easily do this if I had a button that triggered the passing of a request object to the servlet. How do I send a request object on page load - do I need to use Javascript or is this something I can do with just jp...

Reading 200 urls automatically with varying intervals between requests

By calling the example URL below my Java servlet caches one file at a time (with corresponding "filekey"). http://www.example.org/JavaServlet?fileKey=phAwcNAxsdfajsdoj&amp;action=cache Now I have 200 files I'd like to cache ... Instead of calling all these URLs manually I'd like to use fopen, curl or something else to automatically go ...

How to debug a servlet in eclipse without having to deploy it

This is not a programming question but is only relevant to programmers, so I think it is appropriate. How do you go about debugging a program a servlet in Eclipse. Can I somehow use my JSP's to create "simulated" request objects and have the servlets try to handle them, from Eclipse with our without some plugin. This would be ideal if I...

Get form parameters from multipart request without getting the files

I'm looking for a way to get the form parameters of a HTTP multi-part request in a Servlet-filter without uploading files (yet). request.getParameterMap() returns empty. I understand this is because of the request being multi-part. I've looked at commons.HttpFileUpload but this seems to be overkill for my situation. In this filter I'm ...

How do I retrieve the values of checkboxes when the Id values are dynamically generated

I am dynamically naming a set of checkboxes based on certain files names (user is selecting file to include for some processing). Is there a way I can retrieve the files names or do I need to save them to a session object of some sort and then use the retrieved values (from the session object) to retrieve the values of the checkboxes. ...

JSP page without HTML code for exporting data to Excel Sheet

Hi friends, I am facing a problem in exporting my data to excel sheet, this is because of some code which other developers in my team made. So the main problem is to export the data to Excel or .cvs using JSP page but without using any HTML code. Any suggestion would also help me to explore in my developing arena. Thanks for your efforts...

Java Servlet Pooling

Servlets 101, under Tomcat 6: Could someone kindly point me to a good explanation of the best way to eg. create a Collection of expensive Foo objects at servlet startup time and stash them somewhere where I can access them while processing each request? Near as I can tell there are at least three ways to do this and I am a bit fuzzy on...

Getting cannot convert object to ArrayList error when retrieving ArrayList from HttpSession

I have saved an ArrayList to the session object. I am trying to retrieve it using sriList = session.getAttribute("scannedMatches"); I am getting the compile time error "Cannot convert from Object to ArrayList". How can I get my ArrayList back from the session object. ...

forward from servlet in higher directory to jsp in subfolder

Hi. i have root/logged/form.jsp root/servlet root/logged/form.jsp I have jsp page logged/form.jsp this submits form to servlet action="../update". Now i want to add some parameters to request and forward it to logged/form.jsp but its not working and showing me form.jsp in root context only root/servlet. Please help what url should i ...

Some servlet/jetty questions

Having the ServletAPI plus the configurations you can make to jetty or any other web container Do we have a way to limit the request sizes ? (ie to close the connection if posting more that 50 MB) Can we in some way kill the dispatching of a request that is taking too long ? While dispatching a request in your own configured servlet, c...