jsf - 为什么 JSF 不能在带有 @CustomFormAuthenticationMechanismDefinition 的登录页面中工作?
问题描述
我正在尝试使用新的 Java EE 8 安全性。
如果我不在登录页面中使用 JSF,它就可以工作。如果我使用 JSF,则不会显示任何内容,因为表单位于<h:form>
标记(JSF 标记)内。表单外页面的 EL 表达式显示为“ #{bean.property}
”,而不是属性的值。
如果我直接在浏览器中输入登录页面的 URL,页面会正确显示。如果在我尝试访问受保护页面时显示该页面,则无法正确显示。
我尝试使用 Chrome 和 Firefox。由于 Java EE 为登录页面的 URL 添加了“https”,我不得不添加一个异常。是问题吗?
该应用程序使用 Payara 5.182。
页面代码:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/formations/templateBase.xhtml">
<ui:define name="title">
<h:outputText value="#{bundle.Login_Titre}"></h:outputText>
</ui:define>
<ui:define name="content">
#{'HELLO!'} <!-- JUST TO TEST -->
<h:form id="form">
<p><h:outputText value="#{bundle.Login_Message}"/></p>
<h:outputText value="#{bundle.identifiant}"/>
<h:inputText id="login" value="#{loginBean.name}"/>
<h:outputText value="#{bundle.password}"/>
<h:inputSecret id="password"
value="#{loginBean.password}"/>
<p><h:commandButton value="#{bundle.Login_Login}" action="#{loginBean.login}"/></p>
</h:form>
</ui:define>
</ui:composition>
</html>
解决方案
推荐阅读
- python - 根据用户输入返回 URL
- python-2.7 - ImportError:无法在 Odoo 10 中导入名称样式 - ubuntu 18.04
- python - 反序列化错误。权限匹配查询不存在
- html - 谷歌喜欢 CSS 中的选择框样式
- keycloak - Keycloak 正在密码重置链接中发送 HTML 代码
- sql-server - 为 SQL Server 备份目录使用 AWS FSx 文件共享
- tensorflow - Quadro RTX3000 在 GPU 上运行 tensorflow 的正确配置是什么?
- javascript - PowerPoint Javascript API获取演示文稿的幻灯片属性
- python-3.x - Python:如何从 elif 调用的函数返回两个值?
- jenkins - Jenkins slave在执行多分支管道作业时覆盖master设置的环境变量