File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Few doubts

 
R Bhatia
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please let me know in detail :

1. requestDispatcher
2. sendRedirect
3. forward

It will be great if one can provide me difference between above three and which one is to be used preferably.

Regards,
R S
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
read the docs. there is no other better substitute.
 
Krishna Mohan V
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Forward :

When a user asks for a resource, next page is rendered as a response.Just it is a way of displaying the page when a resource is asked by a user.
It is achieved using requestDispatcher.

RequestDispatcher rd = Requestdispacther.getRequestDispather(uri);
rd.forward(HttpServletRequest, HttpServletResponse);

Redirect :

When a user asks for a resouce, server sends a response, which is not the actual requested resource. It does by sending repsonse code of 302 and a URL of the requested resource.
The browser automatically makes a request with this URL and gets the resource.
Thus there is round trip operation between the client and the server. so it should be used in special purposes by using the methods
sendRedirect()...




Go through the documents for further understanding..

Thanks
Krishna Mohan.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"R S B",
You have already been asked to change your display name here and here.

We're light on rules, but we take display names quite seriously. You can read the full report here, but basically we require your display name to be two words: your first name, a space, then your last name. Fictitious names and initials aren't allowed.

Please edit your profile and correct your display name, since accounts with invalid display names get deleted, often without warning.

thanks,
Dave
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Rajat",

Originally posted by David O'Meara:
...basically we require your display name to be two words: your first name, a space, then your last name.


Sorry, but we need two words: your first and then last name, separated by a space
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic