On 14/05/2010 11:33, Pedro Rodrigo Cardiel wrote: > El vie, 14-05-2010 a las 10:50 +0100, Pid escribió: >> >> Please provide exact version numbers of Tomcat, HTTPD etc. > > Apache 2.2.14 > mod_jk 1.2.30-httpd-2.2.3 > tomcat 5.5.27 > >> Can you describe what content you are generating in more detail and how >> you are doing it? > > > > The headers request: > > /Host: rio-iregua.cps.unizar.es:8080/ > /User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; es-ES; > rv:1.9.2.5pre) Gecko/20100421 Ubuntu/9.10 (karmic) Namoroka/3.6.5pre/ > /Accept: > text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8/ > /Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3/ > /Accept-Encoding: gzip,deflate/ > /Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7/ > /Keep-Alive: 115/ > /Connection: keep-alive/ > > The headers response: > > Server: A/pache-Coyote/1.1/ > /Content-Type: text/javascript;charset=UTF-8/ > /Transfer-Encoding: chunked/ > /Content-Encoding: gzip/ > /Vary: Accept-Encoding/ > /Date: Fri, 14 May 2010 10:18:05 GMT/ > > The body response:
<snip>
> The servlet has this code:
>
> /import java.io.IOException;/
> /import java.util.HashMap;/
>
> /import javax.servlet.ServletException;/
> /import javax.servlet.http.HttpServlet;/
> /import javax.servlet.http.HttpServletRequest;/
> /import javax.servlet.http.HttpServletResponse;/
>
> /import org.json.simple.JSONArray;/
> /import org.json.simple.JSONObject;/
>
>
> /public class SearchControllerJSONServlet extends HttpServlet {/
> / /
> / protected void doGet(HttpServletRequest request,
> HttpServletResponse response) throws ServletException, IOException {/
> / this.doPost(request, response);/
> / }/
> / /
> / protected void doPost(HttpServletRequest request,
> HttpServletResponse response) throws ServletException, IOException {/
Mikolaj was close, he meant 'request' not 'response', so to force
session creation add:
HttpSession session = request.getSession(true);
(Arguably you don't need the left hand side of the definition, it's up
to you whether you include it or not)
p
> / if
> ((request.getParameter("operation")).equalsIgnoreCase("queryServer")) {/
>
> ...
> / /
> / String output = //.../
>
> / response.setContentType("text/javascript");/
> / response.setCharacterEncoding("UTF-8");/
> / response.getWriter().write(output);/
> / }/
> / else if
> (request.getParameter("operation").equalsIgnoreCase("getCompleteServer"))
> {/
> / // /
> / //..../
>
> / String output = //... //;/
> / /
> / response.setContentType("text/javascript");/
> / response.setCharacterEncoding("UTF-8");/
> / response.getWriter().write(output);/
> / }/
> / }/
> /}/
>
>
>
>
> --
> ------------------------------------------------------------------------------------------------------------------
> Pedro Rodrigo Cardiel
> Dpto. de Informática e Ingeniería de Sistemas - Universidad de Zaragoza
> C/ María de Luna 1, 50018 Zaragoza, Spain
> Tel: +34 976 762134
> e-mail: [email protected] <mailto:[email protected]>
>
> Grupo IAAA - http://iaaa.cps.unizar.es
> ------------------------------------------------------------------------------------------------------------------
>
>
signature.asc
Description: OpenPGP digital signature
