wood burning stoves 2.0*
The moose likes Servlets and the fly likes calling a servlet from the Java application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "calling a servlet from the Java application" Watch "calling a servlet from the Java application" New topic
Author

calling a servlet from the Java application

Kavita Ghia
Ranch Hand

Joined: Oct 10, 2000
Posts: 91
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

Joined: Nov 17, 2000
Posts: 92
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

Joined: Oct 10, 2000
Posts: 91
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

Joined: Nov 28, 2000
Posts: 83
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calling a servlet from the Java application
 
Similar Threads
How to call PHP methods from Java
how to retrieving windows userName and password
Adding new users through servlets using Mail API
about hidden from fields
Unable to retreive bean object in servlet with request scope