在glassfish中从docroot重定向到外部网址

编程入门 行业动态 更新时间:2024-10-28 12:29:24
本文介绍了在glassfish中从docroot重定向到外部网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我搜索了一下,只找到了解决方法,他们建议在a glassfish前放置一个apache httpd。当然,这是有效的。

但是如果我不希望/不能在glassfish面前摆放任何东西?

<% String redirectURL =stackoverflow/; response.sendRedirect(redirectURL); %>

当我将它指向以下位置时,是否可以让浏览器重定向: http://my.glassfish.domain/ ?

提供一点点更多详细信息:

我尝试将以下属性添加到虚拟服务器: redirect_1 from = / url = stackoverflow/ 但是,这使得一切都被重定向到 stackoverflow / ,例如。 http://my.glassfish.domain/myapp 重定向到stackoverflow/ ,而我只想要 http:// my.glassfish.domain / 被重定向到 stackoverflow/

有什么帮助吗?

解决方案

也许你可以使用 UrlRweriteFilter 根据定义的映射重定向用户。 这里是一些例子

I've googled around and only found solution where they suggest putting an apache httpd in front of glassfish. Sure, that works.

But what if I do not wish to/cannot put any thing in front of glassfish?

Without using the index.jsp in the docroot of the domain to have something like:

<% String redirectURL = "stackoverflow/"; response.sendRedirect(redirectURL); %>

Can I make browser to be redirected when I point it to: my.glassfish.domain/ ?

To provide a little bit more details:

I tried adding a property to the vitual server as: redirect_1 from=/ url=stackoverflow/ But that make everything to be redirected to stackoverflow/, eg. my.glassfish.domain/myapp redirects to stackoverflow/ while all I want was my.glassfish.domain/ to be redirected to stackoverflow/

Any help please?

解决方案

Maybe you can use UrlRweriteFilter to redirect users according to defined mappings. Here are some examples

更多推荐

在glassfish中从docroot重定向到外部网址

本文发布于:2023-10-12 17:45:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1485421.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   网址   glassfish   docroot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!