aspose 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
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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: 14669
    
  11

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: 35223
    
    7
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.


Android appsImageJ pluginsJava web charts
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56153
    
  13

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.


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