0

我正在开发我的 jsf2,jaas,richfaces 应用程序,我有这个登录页面

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich" template = "/WEB-INF/template/login.xhtml" >

        <p>Login to access secure pages:</p>
        <form method='post' action='j_security_check'>
            <h:messages layout='table' errorStyle='background: #AFEEEE;'
                infoStyle='background: #AFEEEE;' globalOnly='true' />
            <h:panelGrid columns='2' styleClass="myTable3">
                <h:outputLabel value='Username: ' />
                <input type='text' id='j_username' name='j_username' />
                <h:outputLabel value='Password: ' />
                <input type='password' id='j_password' name='j_password' />
                <h:outputText value='' />
                <h:panelGrid columns='1'>
                    <input type='submit' name='submit' value='Login' onclick="selectActiveClient();"/>
                </h:panelGrid>
            </h:panelGrid>
        </form>


            <a4j:jsFunction name="selectActiveClient"
                action="#{selectBean.someAction()}"
                render="pannelloClientiAttivi"/>

</ui:composition>

但是 selectActiveClient 没有被调用,怎么了?

4

2 回答 2

0

a4j:jsFunction需要一个表格,用h:form.

于 2013-03-07T04:58:07.400 回答
0

使用 a<h:commandButton>而不是你的<input type='submit' name='submit' value='Login' onclick="selectActiveClient();"/>.

于 2013-03-07T13:10:48.497 回答