• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please Help

 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all friends,
I have one swing interface and I want to call a servlet (which is a chat servlet and It is a pure HTML implementation, so this chat is free from any firewall's restrictions.)
from one sub menu's actionPerformed().My chatServlet working like when i call my servlet from html file (<A HREF="http://127.0.0.1:8080/examples/servlet/ChatServlet?config_file">Chat</A> it first opens login page which is also a html file.I write this html file inside servlet file.I want to open this login page from my swing interface on browser(IE).Can any one plz guide me how I can do that.I tried it with below given code but couldn't slove this problem:-
menuItem = new JMenuItem("Chat", KeyEvent.VK_C);
menuItem.addActionListener (new ActionListener () {
public void actionPerformed (ActionEvent ev)
{
try {
URL url = new URL("http://127.0.0.1:8080/examples/servlet/ChatServlet?config_file");
//what will be the code
}
catch(Exception ex) { ex.printStackTrace();}
}
});
FirstMenu.add(menuItem);

My servlet accept some parameter from this configuration file(config_file.txt).
Regards
Bikash
[ June 14, 2002: Message edited by: Bikash Paul ]
 
Shashi Kanta
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this:

URLConnection servletConnection = url.openConnection();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic