Hi Guys,

I am using JavaMail to develop a WAP mail program. but when I try to create
a SMTP Session object (mail session) using Session class it gives a problem.
session object is not created.when I tried to debug the program using a log
file and it stops at a point where the program tries to create the session.
i.e it will stop at the log output "set smtp". I have given the code here
can any one tell me what the problem is. please help me quickly as this is
very urgent.


public void login(HttpServletRequest request,HttpServletResponse response)
throws ServletException, IOException,MessagingException
  {
    log("inside login");
    try
      {
        String pop3host="http://szeged.logicaltechcorp.com:81";
        String smtphost="http://szeged.logicaltechcorp.com:81";
        String username=request.getParameter("uid");
        String password=request.getParameter("pwd");
    log("user id & password recieved");

        //Get SMTP Session
        Properties props=System.getProperties();
        log("get system property");
        props.put("mail.smtp.host",smtphost);
    log("set smtp");

        Session smtpSession=Session.getInstance(props,null);
        log("Get SMTP Session");
        smtpSession.setDebug(true);
        log(smtpSession.toString());
        //Get POP3 Session
    log("creating POP3 session");
        Session
pop3Session=Session.getInstance(System.getProperties(),null);
        pop3Session.setDebug(true);
    log("Get POP3 Session");


        //Get POP3 Store
        Store pop3Store=pop3Session.getStore("pop3");
        pop3Store.connect(pop3host,username,password);
    log("Get POP3 Store");

        //Create UserSessionData Object
        UserSessionData usd=new
UserSessionData(smtpSession,pop3Session,pop3Store,username);
        this.setUserSessionData(usd);

        //if all OK show main menu
        this.mainMenu(request,response,usd);
       }
     catch(Exception e)
       {
         log("Exception"+e.getMessage());
         e.printStackTrace();
       }
  }//End login


Thanks in advance.

-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Rob
Griffin
Sent: Wednesday, October 11, 2000 4:14 AM
To: [EMAIL PROTECTED]
Subject: Re: Practical Application of Applet-Servlet Communication


Nic,

Being an applet author I just have to buy in here:

> -----Original Message-----
> From:  Nic Ferrier
> Sent: Wednesday, 11 October 2000 3:31
> To: [EMAIL PROTECTED]
> Subject: Re: Practical Application of Applet-Servlet Communication
>
>
> >>> Shital Kanitkar <[EMAIL PROTECTED]> 10-Oct-00 5:08:20 PM >>>
>
> >But I see some practical problems in using Swing on the
> >Web.
>
> >The throughput is terrible.
> - lots of browsers don't support it properly
> - the Java plugin is a pain in the neck
> - it's slow
> - it's memory hungry
>
>
> >So why would anyone want to go in for this kind of an
> >architecture, other than for pure academic purposes?
>
> IMHO mostly coz people are not thinking about how to avoid using
> them.

Surely it's horses for courses. Use applets where the UI demands
greater expressiveness than HTML can provide. I'd love to show you
my work but it's still under wraps at the moment. As soon as I can
I'll post a link here to show what I mean.

>
> A lot of people seem to have an inability to deal with the
> restrictions placed by the web... if you work within those
> restrictions life gets much easier. It seems that most people can't
> move beyond the client-server paradigm.

Why are applets a restriction? If you stick to Java 1.1 then you
have most of the browser market covered. And before you jump on
most, do you use dynamic HTML on your web pages? Or Javascript?
Or images for that matter? Not all browsers support these features.

>
> The distributed web architecture *is* better. It's faster, more
> flexible (accepting the obvious UI restraints) and easier to build.

The obvious UI restraints make some HTML based apps really painful.
Take the JRun administrator, in 2.3 it was an applet, in 3.0 its
all HTML based. I my opinion a big step backwards, from a UI point
of view. Or Microsoft's Developer Network. It had an applet that
showed a tree view of the documentation, now it's HTML based. So when
you select a topic and then return to the tree you have lost your place
in the tree, and are back at the top, whereas the applet remembered your
place. Is this an advance?


>
> People using Swing (and applets generally) are just making their
> lives difficult.
>

Swing maybe, but as for applets I've found it pretty easy actually,
since when I develop I run as an application. Takes the servlet engine
and the browser out of the equation. In fact most of my pain has come
from the installation of my application into various web servers and
servlet engines that have incompatible configuration methods. And that
dud product InstallAnywhere, but that's a completely different saga.

Rob Griffin
Quest Software

E-mail: [EMAIL PROTECTED]
Web site: http://www.quest.com

___________________________________________________________________________
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

___________________________________________________________________________
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