【发布时间】:2021-03-17 06:42:33
【问题描述】:
我正在尝试在我的 JSF 应用程序中使用 ExtensionlessURLs...
我已经在使用:https://showcase.omnifaces.org/facesviews/ExtensionlessURLs 这很好用,但如果我有一个带有参数的 URL,它仍然是:
mypage.jsf?myparameter=12345
是否有可能在这里也排除 .jsf,所以 URL 将是:
mypage?myparameter=12345
我也知道 Prettyfaces 是可用的,但在这里我想我必须为每个 JSF 页面定义一个映射?因此我使用的是 Omnifaces...
有什么可以帮忙的吗?
【问题讨论】:
-
例如喜欢:
ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext(); String id = employee.getId(); ec.redirect(ec.getRequestContextPath() + "/portal/employeeEdit.jsf" + "?id=" + id); -
是的,它被重定向到 /portal/employeeEdit.jsf?id=1234 但我想要:/portal/employeeEdit?id=1234 (=without "jsf").. without参数它可以在 Omnifaces 上正常工作...