java - Handling many simultaneous AJAX requests with a struts2 action -


I've got a Struts 2 verb that responds to an AJAX request with some request parameters, a remote service call Data that XML gives, then changes the data via XSL and returning XHtml as a result of a stream result. The response is different depending on the given criteria.

There is an action class with a group of stuffs moved here:

  public class ServiceHandler ActionSupport extended {Private ByteArrayInputStream inputStream; Public string executed () {string response = ""; // Receive request parameters // request for remote server via HTTP connection // Exxplore results via XSL / // uses dom4j for XML / XSL stuff // This should not be an empty response = ResultDoc.asXML (); Inputstream = new bytereinputstream (feedback .getBytes ()); Return "Success"; } Get public byteforeinestreams inputstream () {inputStream return; }}  

And here are the important struts.xml bits:

   

My problem is that when I have multiple requests run at the same time, all service call the handler action, sometimes the reaction is completely empty (should never be) Sometimes the reaction is disconnected from some random number to beginning or end, and sometimes the responses change, so that an AJAX requestor receives a wrong response.

I know that this thread is a security issue, we have moved all the important variable definitions to the execute () method so that they are not an example variable (and therefore shared by everyone). The only interesting variable that is an instance variable is the inputstream, and I see it because of my problems.

Is there any way to make input strip variable yarn secure? Or is there another way I am not seeing?

I'm only familiar with Strush 1 but take a look in the Take Donolod action or just a plain strip Use the action, write the result directly on the reaction object and return the blank form to the next.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -