DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43557>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43557

           Summary: JK and servlet binary response
           Product: Tomcat 5
           Version: 5.5.20
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P1
         Component: Native:JK
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I have a servlet MyServlet mapped as /servlet/MyServlet/*, this reade a source 
depend relative url before /* and write out binary data, so:

URL url = new URL(urlString);
URLConnection urlc = url.openConnection();
String contentType = urlc.getContentType();

// write headers to response
Map<String, List<String>> headers = urlc.getHeaderFields();
Iterator<String> it = headers.keySet().iterator();
while (it.hasNext()) {
        String key = it.next();
        List<String> value = headers.get(key);
        if (key != null && value != null)
                for (Iterator<String> it2 = value.iterator(); it2.hasNext();) {
                        String element = it2.next();
                        if (element != null)
                                response.addHeader(key, element);
                }
}
response.setContentType(contentType);

// write data to response stream
InputStream in = urlc.getInputStream();
OutputStream out = response.getOutputStream();
int c = 0;
while ((c = in.read()) != -1) {
        out.write(c);
}
in.close();
out.flush();
out.close();

I test this in tomcat with port and work successfully, I have mapped my 
application in apache where my jsps work fine, but when I try MyServlet from 
apache this send me a error (page not found).
I observed putting a System.out.println(any string) in my servlet class and 
this print in the output. I assume the request arrive to the servlet but no 
return the response or Jk no wait, for why?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to