Stephane Vang

Greenhorn
+ Follow
since Feb 11, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Stephane Vang

Hi everybody,

I am faced to a problem that is manage the Httpsession when doing an Ajax request.
I am using Struts 2 and Jquery ajax.
I can manage the HttpSession when I use struts action without ajax. I mean I can put object to my session I get it later.
When I am using $.ajax blablabla , I put object in my session but I can not get it later...

Here is my code :

JSP :

$.ajax({
type: "POST",
data: { type: google.maps.drawing.OverlayType.POLYGON, coordonnees: coordonnees },
url: "<s:url action="getDestinataireFromZone" namespace="/map" />",
dataType:"html",
success: function(data){
$("#destinataire").html("<strong>Nombre de destinataires sélectionné : </strong>" + data);
}

STRUTS 2 ACTION :

public class MapAction extends AbstractAction{
...
public String getDestinataireFromZone(){

...
getSession().put("listeDestinataire", listDestinataireFromSession);
...
inputStream = new StringBufferInputStream(String.valueOf(listDestinataireFromSession.size()));

return SUCCESS;
}

...
}

STRUTS.XML:

<action name="getDestinataireFromZone" method="getDestinataireFromZone" class="MapAction">
<result name="success" type="stream">
<param name="contentType">text/html</param>
<param name="inputName">inputStream</param>
</result>
</action>

I am stucked...

Please Help me

Best Regards

Stéphane

});
12 years ago