File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes forward request using Javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "forward request using Javascript " Watch "forward request using Javascript " New topic
Author

forward request using Javascript

Bhushan Damle
Greenhorn

Joined: Nov 28, 2004
Posts: 21
Can anybody tell me what actually does?
I think it redirects the current window to the new location.
Is there any way in javascript that can forward the request instead of redirect?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

No. The request being a server-side entity, you won't access it from Javascript, so forwarding it is not possible either.


[My Blog]
All roads lead to JavaRanch
Bhushan Damle
Greenhorn

Joined: Nov 28, 2004
Posts: 21
Thanks for the reply.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39534
    
  27
It's not a redirect either (which also makes sense only in the context of a server). Setting the href property replaces the current page with a different one, which leads to an HTTP request being sent to the server.


Ping & DNS - updated with new look and Ping home screen widget
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

Ulf's point is an important one. Many people talk about such changes in page location as "redirects" when, in fact, a redirect is a specific response received from the server that causes the browser to "redirect" to an alternate URL. Clicking a link or using JavaScript to change the page URL does not use the redirect mechanism.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: forward request using Javascript
 
Similar Threads
Difference b/w forward and sendRedirect
problem forwarding a to jsp in struts
how to call sevlet from corejava program?
Servlet [response already committed error]
unable to set the value of Internal attribute using <c:set>