IntelliJ Java IDE
The moose likes HTML, CSS and JavaScript and the fly likes Immediate page forwarding Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Immediate page forwarding" Watch "Immediate page forwarding" New topic
Author

Immediate page forwarding

George Brown
Ranch Hand

Joined: Sep 26, 2000
Posts: 919
Is there a way with javascript that I can forward to another page?
I have an apache server automatically forwarding requests to an index.html page in my web app, and I am looking for that to be instantly forwarded to a jsp.
Any replies appreciated.
Cheers
George
Chris Baron
Ranch Hand

Joined: Mar 21, 2003
Posts: 1028
Hi George

But there's also a special meta-tag for it:
<meta http-equiv="refresh" content="0; URL=http://www.yourdomain.de/forward.jsp">
that better because js may be swiched off.
Also you can configure your webcontainer's welcome/default file list. In Tomcat 4 you find it in conf/web.xml at the very botton for general or in your webapps web-inf/web.xml for webapp-specific purpose
[ May 09, 2003: Message edited by: Christian Baron ]
George Brown
Ranch Hand

Joined: Sep 26, 2000
Posts: 919
Thanks Christian,
I configured the web-app, but there's a combination of a weblogic apache plug-in and apache virtual hosting that seems to ignore my web app welcome list, and automatically forwards to the index.html page. Which is the reason this question cropped up.
So if I use the meta tag,should it still be surrounded by tags as in the following

or should it be just that line in the page by itself?
Chris Baron
Ranch Hand

Joined: Mar 21, 2003
Posts: 1028
Just rigth, doesn't it work ?
George Brown
Ranch Hand

Joined: Sep 26, 2000
Posts: 919
I just tried it, it works perfectly, thanks
 
 
subject: Immediate page forwarding
 
Threads others viewed
Error while forwarding to other page
request.setAttribute()
Forwarding a variable with request scope
If I go to a page B from a page A using forward.so while forwarding to page B,it is considered as ne
JSP called from filter not finding JavaScript file
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com