This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to find the userid of my clients?  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to find the userid of my clients?
------------------
Obuli
 
Sandeep Jain
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
Ur question is too vague . Can u be more specific as to what aur requirements are???

------------------
Try and Try Till u succeed
Sandeep Jain
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"obuliravikumar k",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
Shuaib Gill
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a similar problem. Here is the code I am using:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class AuthorizationSnoop extends HttpServlet
{
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException,IOException
{
res.setContentType("text/html");
PrintWriter out=res.getWriter();

out.println("<html><head><title>Authorization snoop</title></head><body>");
out.println("<h1>This is a password protected resource</h1>");
out.println("<pre>");
out.println("user name: " + req.getRemoteUser());
out.println("authorization type: " + req.getAuthType());
out.println("</pre>");
out.println("</body></html>");
}// end doGet

}// end class
Now the output shows gives values of "null" for user name and authorization type. How can I test this servlet to see if a given username is valid or not? I tried using forms but could not pass the parameters to getRemoteUser() method. How exactly could I use getRemoteUser() without using forms if I cannot pass parameters? What should be the front end application for this servlet? Thanks in advance.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!