Finally i developed the code in jsp..and its working well..all is well..
<%! String host,username,password;%>
<%!Store store;%>
<%!Folder folder;%>
<%
host="pop.aol.com";
username="username@aol.com";
password="password";
Properties props = new Properties();
Session mailsession = Session.getDefaultInstance(props, null);
store = mailsession.getStore("pop3");
store.connect(host, username, password);
folder = store.getFolder("INBOX");
folder.open(Folder.READ_ONLY);
Message message[] = folder.getMessages();
int count=folder.getMessageCount();
out.print(count);
for (int i=0, n=message.length; i<n; i++) {
out.println(i + ": " + message[i].getFrom()[0]
+ "\t" + message[i].getSubject());
}
folder.close(false);
store.close();
%>