File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes how one servelet call another servelet with define http method. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how one servelet call another servelet with define http method." Watch "how one servelet call another servelet with define http method." New topic
Author

how one servelet call another servelet with define http method.

rajnish chattha
Greenhorn

Joined: Dec 01, 2011
Posts: 3
Hi i want to call a servlet from another servlet.I tried it using request dispatcher
String destination="/login";

RequestDispatcher rd = getServletContext().getRequestDispatcher(destination);
rd.forward(request,response);
By doing above..it calls the doPost method of /login servelet and display name of current servlet as URL.
I want that as soon as Requestdisatcher get execute then www.//domainname/login url should appear as login URL.
How it can be done in java..am quite new java technology..!
Kumaravadivel Subramani
Ranch Hand

Joined: Jul 05, 2008
Posts: 166

If you wanted to display the log in page with URL change then use

It will change the current servlet name to redirect servlet name in the URL.


No pain, No gain.
OCJP 1.6
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61204
    
  66

Why is the URL in the address bar important?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how one servelet call another servelet with define http method.