Hi,

Probably missing something simple here but I can't figure it out... I
have pretty much just modified a simpel hello world servlet as I start
to play around with NIO sendfile support. I am using Tomcat 6.0.20. I
am trying to check for the org.apache.tomcat.sendfile.support which
says I can use the sendfile mode. When I request the request
atttributes in the doPut method via getAttributeNames(), I seem to get
back an Enumeration with no attribute names in it. None... But when I
ask for the org.apache.tomcat.sendfile.support attribute specifically
via getAttribute(), I do get the attribute and it is correctly set to
Boolean true/false depending on whether I've configured NIO in
server.xml.

Here is my code:

       protected void doGet(HttpServletRequest request, HttpServletResponse
                                   response) throws ServletException,
IOException {
               Enumeration<String> attrNames = request.getAttributeNames();
               if (attrNames == null) {
                       System.out.println("getAttributeNames returned null");
               } else {
                       System.out.println("attrNames: " + attrNames.toString());
               }
               System.out.println("printing any attrs...");
               while (attrNames.hasMoreElements()) {
                       String attrName = attrNames.nextElement();
                       System.out.println("attr: " + attrName);
               }
               Boolean val = (Boolean)

request.getAttribute("org.apache.tomcat.sendfile.support");
               if (val != null) {

System.out.println("org.apache.tomcat.sendfile.support attr found:
                            value: " + val.toString());
               } else {

System.out.println("org.apache.tomcat.sendfile.support attr not
found");
               }

               response.getWriter().write("Hello, world!");
       }

Thanks in advance for any help on this...

Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to