wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 41034
    
  43
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 - my free Android networking tools app
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60739
    
  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]
 
wood burning stoves
 
subject: forward request using Javascript
 
Similar Threads
problem forwarding a to jsp in struts
Servlet [response already committed error]
how to call sevlet from corejava program?
Difference b/w forward and sendRedirect
unable to set the value of Internal attribute using <c:set>