JSF项目阶段中断导航

时间:2014-01-15 23:19:34

标签: jsf jsf-2 jboss

我面临一种奇怪的行为。如果我将web.xml中的jsf项目阶段更改为与Development不同的内容,则会破坏系统导航。例如:如果我单击commandButton打开新页面,服务器将在原始URL旁边的地址栏上返回“#”符号,并且不会打开新页面。这很奇怪,因为它只有在我将Project Stage设置为Development时才有效。我在Jboss EAP 6.2.0(Jboss 7.3)上使用mojarra 2.1。

在mojarra或Jboss中一定是某种bug。自Jboss 7.1以来,我一直在尝试所有可能的组合。

有人遇到类似的问题吗?

我的web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>SSI 2.0 - COMPRAS</display-name>
<context-param>
<param-name>nomesistema</param-name>
<param-value>SSI</param-value>
</context-param>
<context-param>
<param-name>versaosistema</param-name>
<param-value>2.0</param-value>
</context-param>
<context-param>
<param-name>modulosistema</param-name>
<param-value>COMPRAS</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.writeStateAtFormEnd</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.numberOfViewsInSession</param-name>
<param-value>3</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.numberOfLogicalViews</param-name>
<param-value>10</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<context-param>
<param-name>org.richfaces.skin</param-name>
<param-value></param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/balusc.taglib.xml</param-value>
</context-param>
<context-param>
<param-name>caminhouploads</param-name>
<param-value>/usr/compras/upload/</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<multipart-config>
<location>/var/tmp</location>
<max-file-size>31457280</max-file-size>
<max-request-size>62914560</max-request-size>
<file-size-threshold>1048576</file-size-threshold>
</multipart-config>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<filter>
<filter-name>MultipartFilter</filter-name>
<filter-class>com.ssi.compras.utils.MultipartFilter</filter-class>
<init-param>
<param-name>location</param-name>
<param-value>/usr/compras/upload</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>MultipartFilter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

登录页面(index.xhtml):

<ui:composition template="template/login.xhtml" 
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:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">

<ui:define name="loginsistema">
    <h:form id="formLogin">
            <div class="area-campos-login">

                <div class="area-input-100">
                    <h:selectOneMenu id="dominio" value="#{loginMB.dominio}" required="true" styleClass="select-form-login">
                        <f:selectItems value="#{dominiosMB.recuperar()}" var="dominio" itemLabel="#{dominio.cnmdominio}"/>
                        <f:converter converterId="dominioConv"/>
                    </h:selectOneMenu>              
                </div>

                <div class="area-input-100">
                    <h:outputText value="Login:"/>
                    <h:inputText size="18" id="identificacao" styleClass="input-form-login" value="#{loginMB.usuario.cnmlogin}" required="true" onkeypress="return validaTecla(event,'mpCaracterInvalido');"></h:inputText>
                </div>

                <div class="area-input-100">
                    <h:outputText value="Senha:"/>
                    <h:inputSecret size="18" id="senha" styleClass="input-form-login" value="#{loginMB.usuario.cnmsenha}" required="true"/>
                </div>

            </div>

            <div class="barra-entrar">
                <div class="botoes-entrar">
                    <div class="ico-cadeado"><img src="imagens/login_cadeado.png"/></div>
                    <div class="entrar-login">
                        <h:commandLink action="#{loginMB.logar()}" id="botaoLogin">Entrar</h:commandLink>
                    </div>
                    <div class="seta-dir"></div>                
                </div>
            </div>  
        </h:form>
</ui:define>

模板页面(template / login.xhtml)

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

<h:head>
<meta http-equiv="Pragma" content="No-cache"/>
<meta http-equiv="Cache-Control" content="no-store,No-cache,must-revalidate,post-check=0,pre-check=0,max-age=0"/>
<meta http-equiv="Expires" content="-1"/>
<title><h:outputText value="#{parametrosSistema.recuperaCabecalho()}"/></title>

<h:outputStylesheet name="css/geral.css" />



<style>
    body {
        margin:0;
        padding:0;
    }

    form {
        margin:0
    }

    @font-face {
     font-family: officina;
     src: url("font/officinaserifitcttbook.eot") /* EOT file for IE */
    }
    @font-face {
     font-family: officina;
     src: url("font/officinaserifitcttbook.ttf") /* TTF file for CSS3 browsers */
    }       
    @font-face {
     font-family: officina;
     src: url("font/officinaserifitcttbook.woff") /*  */
    }       
    @font-face {
     font-family: officina;
     src: url("font/officinaserifitcttbook.otf") /*  */
    }

    .topo-login {
        width:100%;
        height:160px;
        border-bottom: 1px solid #c8c8c8;

        background: #ffffff; /* Old browsers */
        background: -moz-linear-gradient(top,  #ffffff 0%, #eeeeee 34%); /* FF3.6+ */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(34%,#eeeeee)); /* Chrome,Safari4+ */
        background: -webkit-linear-gradient(top,  #ffffff 0%,#eeeeee 34%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top,  #ffffff 0%,#eeeeee 34%); /* Opera 11.10+ */
        background: -ms-linear-gradient(top,  #ffffff 0%,#eeeeee 34%); /* IE10+ */
        background: linear-gradient(to bottom,  #ffffff 0%,#eeeeee 34%); /* W3C */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); /* IE6-9 */

    }
        .logomarca-login{
            margin: 0 auto;
            width:240px;
            height:110px;
        }
        .logomarca-login img{
            margin-top:20px;
        }

    .conteudo-login {
        border-top: 1px solid #ffffff;
        background: #eeeeee;

    }
        .area-campos-login {
            height: 220px;
            width: 240px;
            margin: 20px auto 0;
        }   

        .barra-entrar {
            width:100%;
            height:40px;

            background: #0085f4; /* Old browsers */
            background: -moz-linear-gradient(top,  #0085f4 0%, #0066cc 99%); /* FF3.6+ */
            background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#0085f4), color-stop(99%,#0066cc)); /* Chrome,Safari4+ */
            background: -webkit-linear-gradient(top,  #0085f4 0%,#0066cc 99%); /* Chrome10+,Safari5.1+ */
            background: -o-linear-gradient(top,  #0085f4 0%,#0066cc 99%); /* Opera 11.10+ */
            background: -ms-linear-gradient(top,  #0085f4 0%,#0066cc 99%); /* IE10+ */
            background: linear-gradient(to bottom,  #0085f4 0%,#0066cc 99%); /* W3C */
            filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0085f4', endColorstr='#0066cc',GradientType=0 ); /* IE6-9 */
        }

        .botoes-entrar {
            width:240px;
            margin:0 auto;
            font-family: officina;
            color:#fff;
        }
        .ico-cadeado {
            width:120px;
            float:left;
        }
        .ico-cadeado img{
            margin-top:-2px;
        }           
        .entrar-login {
            width:100px;
            text-align:right;
            float:left;
            margin-top: 6px;
        }
        .entrar-login a {
            color: #FFFFFF !important;
            font-family: officina;
            font-size: 1.7em;
        }           


    .rodape-login {
        width:100%;
        height: 70px;
        position: relative;

        background: #eeeeee; /* Old browsers */
        background: -moz-linear-gradient(top,  #eeeeee 0%, #ffffff 100%); /* FF3.6+ */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */
        background: -webkit-linear-gradient(top,  #eeeeee 0%,#ffffff 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top,  #eeeeee 0%,#ffffff 100%); /* Opera 11.10+ */
        background: -ms-linear-gradient(top,  #eeeeee 0%,#ffffff 100%); /* IE10+ */
        background: linear-gradient(to bottom,  #eeeeee 0%,#ffffff 100%); /* W3C */
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */

    }
        .logomarca-vivo-login {
            float:right;
            margin-right:20%;
        }
        .logomarca-telefonica-login {
            float:left;
            margin-left:20%;
        }

    .seta-dir {
        width:20px;
        height:20px;
        background: url('imagens/setas.png') no-repeat 0 5px;
        float:left;
        margin-top: 6px;
    }

    .label {
        font-size:0.9em;
        color:#797979;
        margin-right:26px;
        font-family: Arial;
    }

</style>

</h:head>
<h:body>

<div id="divContent">

    <div class="topo-login">
        <div class="logomarca-login">
            <img src="imagens/login_logo.png"/>
        </div>
    </div>
    <div class="conteudo-login">
        <ui:insert name="loginsistema"/>
    </div>
    <div class="clear"></div>
    <div class="rodape-login">
        <div class="logomarca-telefonica-login">
            <img src="imagens/rodape_telefonica.png"/>
        </div>
        <div class="logomarca-vivo-login">
            <img src="imagens/rodape_vivo.png"/>
        </div>
    </div>

</div>    

<a4j:outputPanel id="panelerrologin">
    <h:panelGroup id="pgexibeerrologin" rendered="#{loginMB.flagerroautenticacao}" showWhenRendered="#{loginMB.flagerroautenticacao}" layout="block" styleClass="erro">
        <div class="erro-simbolo"/>
        <h:outputText value="Autenticação falhou !" />
    </h:panelGroup>
</a4j:outputPanel>

<script type="text/javascript">

$(document).ready(function(){
    var janela = $(window).height();
    $('.conteudo-login').css('height',janela-235+'px');

    });

</script>

  </h:body>
</html>

0 个答案:

没有答案