错误 404--未找到(使用 apache 和 weblogic 时)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/743541/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error 404--Not Found (while using apache and weblogic)
提问by
I have an application deployed in weblogic, and am using apche server.Normally, when I enter the url for the application, it should display a jsp (1) kind of please wait then this one will redirect to another jsp (2).
我在 weblogic 中部署了一个应用程序,并且正在使用 apche 服务器。通常,当我输入应用程序的 url 时,它应该显示一种 jsp (1),请稍候,然后这个将重定向到另一个 jsp (2)。
the problem is when I enter the url of the application, it displays jsp (1) "please wait" and while redirecting it gives the error (Error 404--Not Found).
问题是当我输入应用程序的 url 时,它显示 jsp (1)“请稍候”,并且在重定向时给出错误(错误 404--未找到)。
What do you think the problem is ?
你认为问题是什么?
回答by BalusC
A 404 simply means that the URL is invalid or that the resource actually isn't there where you think it is.
404 仅表示 URL 无效或资源实际上不在您认为的位置。
First test its availablility independently with an absolute URL. Such as http://example.com/context/page.jsp. If that doesn't work, then verify if the resource is actually there in your webapp where you expect it to be. If that does work, then you likely used a relative URL in the redirect such as:
首先使用绝对 URL 独立测试其可用性。比如http://example.com/context/page.jsp。如果这不起作用,则验证资源是否确实存在于您的 web 应用程序中您期望的位置。如果确实有效,那么您可能在重定向中使用了相对 URL,例如:
<meta http-equiv="refresh" content="3;url=/page.jsp">
You need to be aware that any relative URL's in the page are relative to the absolute URL of the current request. Thus, if the page was requested with for example http://example.com/context/wait.jsp, then the above relative URL will resolve to http://example.com/page.jsp. This is thus not going to work if the page is actually located at http://example.com/context/page.jsp. You should then replace the URL by the right relative URL:
您需要注意页面中的任何相对 URL 都相对于当前请求的绝对 URL。因此,如果使用例如 请求页面http://example.com/context/wait.jsp,则上述相对 URL 将解析为http://example.com/page.jsp。因此,如果页面实际上位于http://example.com/context/page.jsp. 然后你应该用正确的相对 URL 替换 URL:
<meta http-equiv="refresh" content="3;url=page.jsp">
or just an absolute URL:
或者只是一个绝对 URL:
<meta http-equiv="refresh" content="3;url=http://example.com/context/page.jsp">

