简体   繁体   中英

How to make JSF EL function inside a <script> tag

Does Anyone know how to make this properly work? I have to put some JSF EL inside the script tag, but the renderer isn't recognizing it.

    <f:verbatim>
    <script type="text/javascript">
        $(function() {
            $("#paginator").paginate({
                count: #{parceirosFrontControl.paginator.pagesTotal}, // total of pages
                start: #{parceirosFrontControl.currPage}, // current page
                display: #{parceirosFrontControl.paginator.pagesVisible}, // amount of visible pages
                border: false,
                text_color: '#888',
                background_color: '#EEE',   
                text_hover_color: 'black',
                background_hover_color: '#CFCFCF'
            });
        });
    </script>
    </f:verbatim>

Thanks in advance for any help!

Just remove the <f:verbatim> tag. It is blocking the EL expressions from being evaluated.

This old JSF 1.x artifact serves an entirely different purpose and has been deprecated since JSF 2.0. Do not ever use it.

See also:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM