I cant seem to get the user name using request.getRemoteUser().
Since the user logs in via htpasswd, I should be able to get his/her username
via this method. However, I keep getting "null" instead of the actual username.

I stumped. Is there something wrong with the code below ? Any help would be
appreciated :)

                        String username = request.getRemoteUser();
                        // Returns the name of the user making this request, or null 
if not known.
                        if (username == null)
                        {
                                response.getWriter().println("Sorry. Mummy said never 
talk to strangers");
                        }
                        else
                        {
                                // Do your thing here....
                                // At startup, make the form ready for user queries
                                display_query_result(request, response, "start");
                        }

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to