请问某个index.jsp文件中的一行jsp代码:
<% response.sendRedirect("page/"); %>
这个重定向语句中的"page/",表达了要跳转到什么路径?
你好,我是问答小助手。为了技术专家团可以更好地为您解答问题,烦请您补充下(1)问题背景详情,(2)您想解决的具体问题,(3)相关图片,便于技术专家团更好地理解问题,并给出解决方案。
您可以点击问题下方的【编辑】,进行补充修改问题。
response.sendRedirect(这里面填的应该是地址)
你这个page/有没有可能是写错了,应该是/page
response.sendRedirect重定向,就是让客户端跳转访问另一个url地址,所以后面跟的是你想让客户访问的url地址,一般是servlet或者controller里定义的
补充:
1、完整的index.jsp文件代码是:
<%--
#%L
Alfresco Share WAR
%%
Copyright (C) 2005 - 2016 Alfresco Software Limited
%%
This file is part of the Alfresco software.
If the software was purchased under a paid Alfresco license, the terms of
the paid license agreement will prevail. Otherwise, the software is
provided under the following open source license terms:
Alfresco is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Alfresco is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
#L%
--%>
<%@ page session="false" %>
<% response.sendRedirect("page/"); %>
2、以上代码没有写错,现在服务器正在正确运行,能够正确登录各个账号,是alfresco社区版的登录页的index.jsp文件;
我也很奇怪这个路径能够正确运行;
3、但是,在另一个第三方网站的iframe页面里,想嵌入式地打开这个网址,就显示服务器拒绝了你的请求(而同样的其他网址,如www.baidu.com等其他网址,是可以打开的)。
感觉是“response.sendRedirect(...)“这句有问题,所以提出这个疑问。
很困惑啊