Java 如何将bean放入css样式按钮

Java 如何将bean放入css样式按钮,java,css,jsf,jsf-2,primefaces,Java,Css,Jsf,Jsf 2,Primefaces,我在JSF2中使用PrimeFaces3.5,我的页面有coustom菜单和css样式表 我只创建了一个用于注销的按钮,但我不知道如何在不破坏按钮样式的情况下正确放置注销bean 由bean编写的是: #{loginBean.doLogout} HTML页面代码: <body > <ui:composition template="/Templates/MasterTemplate.xhtml"> <ui:define name

我在JSF2中使用PrimeFaces3.5,我的页面有coustom菜单和css样式表

我只创建了一个用于注销的按钮,但我不知道如何在不破坏按钮样式的情况下正确放置注销bean

由bean编写的是:

#{loginBean.doLogout} 
HTML页面代码:

    <body >

    <ui:composition template="/Templates/MasterTemplate.xhtml">
        <ui:define name="content">
<div class="inside">
    <div class="trans">
        <div class="fix">
        <a class="logo" href=""></a>
        <div class="show">
        <ul class="menu">
        <li > <a href="">اتصل بنا</a></li>
        <li > <a href="">LogOut button</a></li>  <<<***** here i want to put the tage ******* 
        <li > <a href="">التقارير</a>
        <ul >
        <li><a href="#{request.contextPath}/secured/Report/Student/SpecificStudent.xhtml">تقرير عن طالب محدد</a></li>
        <li><a href="#{request.contextPath}/secured/Report/Student/SpecificClass.xhtml">تقرير عن فصل محدد</a></li>
        </ul>
        </li>
        <li > <a href="http://sams-app.com/almnzm2-0/">الرئيسية</a></li>
        </ul>
        </div>
        <div class="both">
        </div>
    </div>
    </div>
</div>
<br />
<br />


<p:meterGaugeChart id="sample" value="#{chartBean.meterGaugeModel}" style="width:400px;height:250px" title="مستوى الحضور أمس لجميع الطلاب" label="نسبة الحضور/الطلاب"/>  



<p:meterGaugeChart id="custom" value="#{chartBean.meterGaugeModel}" showTickLabels="true" labelHeightAdjust="110" intervalOuterRadius="130"   
                               seriesColors="66cc66, 93b75f, E7E658, cc6666" style="width:400px;height:250px" title="Custom Options" label="km/h"/>  


        </ui:define>
    </ui:composition>
</body>
</html>

  • 您可以使用
    或在
    中添加css样式,使其看起来像一个按钮。

    试试这个

    <h:commandButton 
        onclick="window.location.assign('#{request.contextPath}#{loginBean.doLogout}');return false;" />
    
    
    
    <h:commandButton 
        onclick="window.location.assign('#{request.contextPath}#{loginBean.doLogout}');return false;" />