aspose file tools*
The moose likes Servlets and the fly likes request.getRemoteuser() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "request.getRemoteuser()" Watch "request.getRemoteuser()" New topic
Author

request.getRemoteuser()

shivani anand
Ranch Hand

Joined: Dec 28, 2000
Posts: 155
Is there any way to know that mail I sent to someone was read by the receiver or not? Can servelets request.getRemoteUser() fullfill this purpose
sa
Chris Reeves
Ranch Hand

Joined: Apr 03, 2002
Posts: 95
getRemoteUser just tells you the username of the client on the other end (assuming you prompted them for a username/password).
To tell if they're received or read a message, you need to request a receipt with the mail message. It has nothing to do with http/servlets/etc.
Sanjeev Shahi
Ranch Hand

Joined: Feb 26, 2001
Posts: 83
thanks chris for your reply.
There is one more ques. realted to this for instance when you send egreeting to someone you get notified when the receiver opens that greeting, so my ques. is how that happens? Is there no way to grab info who clicked my url?
sa
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
There are lots of things you can tell about who clicked a URL: the IP address of the client machine (unless they are accessing through a proxy or firewall, etc.), the domain name of the client machine (unless they are accessing through a proxy or firewall, or get their IP address through DHCP and don't have a domain name, etc.), the type and version of the browser (unless they are accesing through a system which disables ths information, or they have set up their browser to send incorrect browser information etc.).
I hope you get the picture, anything sent by a browser is potentially unreliable. Likewise with mail receipts. I hate them and always configure my email system to never return them. So do many others.
So how do those greetings work? Simple, they send a complicated, unique URL to each recipient, encoding the recipient details and some redundancy to ensure it can't easily be guessed. For example, if you see something like the following in the message:
< img src='http://www.supergreetings.com/message/123-78DX-957643-36/logo.gif' >
You can be pretty sure that the recipient information (or at least some sort of recipient id) is contained in the gibberish numbers somewhere.
All that remains is for the server code to extract that information from the URL, and it knows that the message has been viewed by the recipient.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Chris Reeves
Ranch Hand

Joined: Apr 03, 2002
Posts: 95
Frank is right on - avoid the e-mail receipt business. I really find it to be more of an invasion than a convenience.
One more thing to add regarding the URL encoding.
When user A sends a "supergreeting" to user B, a message is sent with a URL inside. When user B clicks on the URL, a request is sent to the server, which captures the notion that user B has requested his greeting (from the data, userid, whatever, embedded in the URL), and returns the right greeting. The server can then notify user A that user B is checking out the greeting. Spiffy.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: request.getRemoteuser()