Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling a servlet from the Java application

 
Kavita Ghia
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,
First of all a very happy New Year to all of you.Hope this New Year brings lots of joy and prosperity to everyone's life.
Now the question:
How do I call a servlet from my Java application?
I have developed a swing application whic is asking for the username and password.Inorder to verify the username and password I want to call the servlet,once he clicks on the login button and then he is redirected to a particular URL.Please reply soon as it is preety urgent.
Regards,
Kavita.
 
Preethi Suryam
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Happy New Year....
coming to u r doubt i think u can use URL class for invoking a servlet.please be clear about u r redirection part..so that i can help u.
Regards
preethi.
 
Kavita Ghia
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Preethi,
what I mean about redirection is the authenticated user will be sent to a particular html page.Hope this clarifies the question.
Thanks.

Regards,
Kavita.
 
Kevin Mukhar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is an example in the Java network tutorial at http://java.sun.com/docs/books/tutorial/networking/urls/index.html which shows how an application can connect to a url.
There's an example at http://pages.about.com/kmukhar/ showing how an applet can connect to a servlet. The code will work the same for application to servlet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic