我正在努力改变我的h:outputLabel的宽度,但我仍然无法改变它.
通过使用CSS,我可以更改颜色,字体,框架,但不是WIDTH.
非常感谢.
在哪里可以找到 XML 模式定义
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
Run Code Online (Sandbox Code Playgroud)
或自 JSF 2.2
xmlns:jsf="http://xmlns.jcp.org/jsf"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:a="http://xmlns.jcp.org/jsf/passthrough"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
Run Code Online (Sandbox Code Playgroud)
?
我对<ui:repeat>标签有一个奇怪的问题.即使对于我非常简单的示例,嵌套重复组件中的值绑定也无法按预期工作.
我有一个像这样的简单小脸:
<h:body>
<h:form>
<ui:repeat value="#{sandbox.rows}" var="row">
<ui:repeat value="#{row.columns}" var="column">
<h:outputText value="#{column.value}" />
<h:selectBooleanCheckbox value="#{column.value}" />
</ui:repeat>
<br/>
</ui:repeat>
<h:commandButton action="#{sandbox.refresh}" value="Refresh" />
</h:form>
</h:body>
Run Code Online (Sandbox Code Playgroud)
和沙盒类:
@Component
@Scope("request")
public class Sandbox {
public static class Row {
private List<Column> columns = Arrays.asList(new Column(), new Column());
public List<Column> getColumns() {
return columns;
}
}
public static class Column {
private boolean value;
public void setValue(boolean value) {
this.value = value;
}
public boolean getValue() {
return this.value;
}
} …Run Code Online (Sandbox Code Playgroud) 我是JSF的新手,在表单中显示条件部分时遇到一些奇怪的问题.
我的面孔:
<h:form id="animalForm">
<h:selectOneRadio id="animal" onchange="submit()" value="#{index.animal}">
<f:selectItem itemLabel="Cat" itemValue="1"/>
<f:selectItem itemLabel="Dog" itemValue="2"/>
</h:selectOneRadio>
</h:form>
<h:outputText value="#{index.animal}"/>
<c:if test="#{index.animal eq 1}">
<h:outputText value="Cat"/>
</c:if>
<c:if test="#{index.animal eq 2}">
<h:outputText value="Dog"/>
</c:if>
Run Code Online (Sandbox Code Playgroud)
还有我的豆子:
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
@ManagedBean(name = "index")
@RequestScoped
public class IndexBean {
public static final int CAT = 1;
public static final int DOG = 2;
private int animal;
public IndexBean() {
}
public int getAnimal() {
return animal;
}
public void setAnimal(int animal) {
this.animal = …Run Code Online (Sandbox Code Playgroud) 我有一个自定义EL函数(定义myfunctions.taglib.xml)返回一大块HTML,我想逐字复制到输出,
<f:verbatim>
#{mylib:generateHtml()}
</f:verbatim>
Run Code Online (Sandbox Code Playgroud)
但是,#{...}的扩展总是被转义.如何让它不被逃脱?
除了c:if或者c:choose,有没有更好的方法来实现几个组件中的1个组件的条件渲染.像JSF页面的开关案例?
是否可以创建自定义JSF核心Facelet组件.喜欢的东西<custom:composition>的<ui:composition>,或者<custom:include>用于<ui:include>
这将是有益的,如果有人能告诉我涉及的步骤.
提前致谢,
Kaushal
如何<c:if>在Facelets中使用OR条件?如果是3或2或5,我需要检查私处.
<c:if test="#{Privlage=='3'or '2' or '5'}" >
Run Code Online (Sandbox Code Playgroud) 我的login.xhtml开头是:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Run Code Online (Sandbox Code Playgroud)
我使用的是Java 8,JSF,Primefaces,Maven,Tomcat8.我认为我的配置有问题,例如servlets和web.xml.