• Post Reply Bookmark Topic Watch Topic
  • New Topic

Javamail interface error  RSS feed

 
Gibson Tang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using Javamail API and i seem to get this error for the below line of code

"Method getTransport() not found in interface javax.servlet.http.HttpSession.
Transport transport = session.getTransport();"






I've already imported
<%@ page import="java.util.*, javax.mail.*, javax.mail.internet.*, javax.mail.Message" %>
<%@ page import="javax.mail.Transport, javax.mail.Session, javax.activation.*" %>
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Transport transport = session.getTransport();


I think you meant to write:

Transport transport = s.getTransport();


"session" refers to the implicit JSP page object of type HttpSession.
[ August 04, 2006: Message edited by: Ulf Dittmer ]
 
Gibson Tang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, that fixed the error and i feel so stupid . Now my error is

 
Gibson Tang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Managed to fix that error by adding



Thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!