I have this piece of code:
$('#faq').click(function () { var url = $.get('faq', { pagina: 'page' }); alert(url); });
On ‘faq’ responds to a Servlet that sets an attribute on the request
.... request.setAttribute('pageFAQ', pageFAQ); ....
After the get jQuery prints [object XmlHttpRequest].
I would like to access to the attribute set in the Servlet but I don’t know how to do it.
I’m not sure that a servlet request attribute is shared with the client.
You can get hold of the response text in jQuery like so:
All you need to do is let your servlet return some text.