Liferay控制面板的返回URL问题:http://one:8080/group/control_panel/null
来源:互联网 发布:mac删除文件 编辑:程序博客网 时间:2024/05/09 19:52
在liferay的测试环境的ip变更后,控制面板的返回URL为http://one:8080/group/control_panel/null了。
发现配置文件中的IP没有及时修改。
#### Redirect## # # Set this property to "ip" or "domain" for the redirect security method. If # set to "domain", the portal will only redirect users to domains listed in # the property "redirect.url.domain.allowed". If set to "ip", the portal # will only redirect to domains whose IP address resolve to an IP address # listed in the property "redirect.url.ip.allowed". # #redirect.url.security.mode=domain redirect.url.security.mode=ip # # Input a list of comma delimited domains which the portal is allowed to # redirect to. Input a blank list to allow any domain. # redirect.url.domains.allowed= # # Input a list of comma delimited IPs which the portal is allowed to # redirect to. Input a blank list to allow any IP. SERVER_IP will be # replaced with the IP of the host server. # redirect.url.ips.allowed=127.0.0.1,SERVER_IP redirect.url.ips.allowed=
原来的设置类似如下:
redirect.url.ips.allowed=127.0.0.1,192.168.0.1
虚拟主机对应不起来,所以就变为null。
解决办法:
1,这个地方设置为空:
redirect.url.ips.allowed=
2,设置虚拟主机的IP地址。
redirect.url.ips.allowed=127.0.0.1,虚拟主机的IP
为啥呢?看看代码就知道了。
public String escapeRedirect(String url) {if (Validator.isNull(url) || !HttpUtil.hasDomain(url)) {return url;}try {String securityMode = PropsValues.REDIRECT_URL_SECURITY_MODE;String domain = StringUtil.split(HttpUtil.getDomain(url), StringPool.COLON)[0];if (securityMode.equals("domain")) {String[] allowedDomains =PropsValues.REDIRECT_URL_DOMAINS_ALLOWED;if ((allowedDomains.length > 0) &&!ArrayUtil.contains(allowedDomains, domain)) {if (_log.isDebugEnabled()) {_log.debug("Redirect URL " + url + " is not allowed");}url = null;}}else if (securityMode.equals("ip")) {String[] allowedIps = PropsValues.REDIRECT_URL_IPS_ALLOWED;InetAddress inetAddress = InetAddress.getByName(domain);if ((allowedIps.length > 0) &&!ArrayUtil.contains(allowedIps, inetAddress.getHostAddress())) {String serverIp = getComputerAddress();if (!serverIp.equals(inetAddress.getHostAddress()) ||!ArrayUtil.contains(allowedIps, "SERVER_IP")) {if (_log.isDebugEnabled()) {_log.debug("Redirect URL " + url + " is not allowed");}url = null;}}}}catch (UnknownHostException uhe) {if (_log.isDebugEnabled()) {_log.debug("Unable to determine IP for redirect URL " + url);}url = null;}return url;}
- Liferay控制面板的返回URL问题:http://one:8080/group/control_panel/null
- Liferay 对普通用户隐藏控制面板
- GetDlgItem()返回NULL的问题
- liferay的权限控制
- liferay修改、去掉右上角控制面板等源码路径
- liferay 在控制层Java中获取当前网页URL后面跟着的参数
- http访问url的问题
- 控制面板的编程
- 控制面板的快捷方式
- 控制面板的快捷键
- getBestProvider总是返回null问题的解决之道
- getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS) 返回null的问题
- Android ActionBar返回null的问题
- google map 返回null 的问题
- gethostbyname返回NULL的问题分析
- spring getHibernateTemplate() 返回null的问题
- 关于Json返回null的问题
- ToolProvider.getSystemJavaCompiler() 返回 null的问题
- ZStack API解读3
- netty3.2.3源码分析-ClientBootstrap启动分析
- <algorithm.h>中sort对结构体排序的用法
- 网站压力测试 – webbench
- hdu 2084 dp
- Liferay控制面板的返回URL问题:http://one:8080/group/control_panel/null
- android获取联系人所有内容
- 解决“the symbol file *.pdb does not match the module”
- HDU_2825 Wireless Password AC自动机+dp
- Using Private Credential Vault Slot in WebSphere Portal 6.1
- NET检测文件和文件夹是否存在的方法
- Efficient C Tips #5 – Make ‘local’ functions ‘static’
- Zstack Zmain流程
- Scanner典型用法