• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

accessing authenticated web page using servlets

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi everyone ,
i m doig a project in servlets to get the username n passowrd from the
user and then displaying their mail inbox ..... for example. if we want to
display the search results of the word " mail " in google we can do it
by the method
"res.sendRedirect(http://www.google.com/search?nhl=en&lr=&q=mail); "
but how can we use this sendredirect method to access the mail like
providing user name and password and then displaying their inbox to
users.


please someone try to give me some solution,


thanks in advance


ashok
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't. Accessing a mail account is completely different than accessing a web page (for starters, it's done using the POP or IMAP protocols, not HTTP). You need to use the JavaMail API to retrieve the mailbox contents, and then convert that to a web view. But there are a number of Java web apps out there that do exactly this and are open source, so there's not much point in reinventing the wheel (unless the point is to learn web app development and JavaMail).
[ January 02, 2007: Message edited by: Ulf Dittmer ]
 
ashok ganesan
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi thanks a lot. . . . ok how about any other web page or site that requires authentication that is we need to provide the user name and passowrd to access the site .. in those case how we should do it?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you mean by "how we should do it". If a web site requires authentication, then you'll have to enter username and password when it asks for it. Or or are you trying to access a password-protected web app programmatically? Then you'd set the authentication header as described here.
 
Ranch Hand
Posts: 472
Objective C Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to do that in exact way as you provided. For example, if you need to loging in google mail use:
res:redirect(http://mail.google.com?continue=http://mail.google.com/mail?ui=html&zy=l&service=mail&rm=false<mpl=cm_wsad&Passwd=1234561&Email=ashok@gmail.com)

Unfortunately, you need to do a bit reverse engineering to discover login string of a particular e-mail progam, unless it uses container managed authentication.
reply
    Bookmark Topic Watch Topic
  • New Topic