简体   繁体   English

f:viewAction不要调用动作

[英]f:viewAction don't invoke action

I´m using Weblogic server 12.1.2, JSF 2, Mojarra 2.2.4 and I have the next code in a page: 我正在使用Weblogic服务器12.1.2,JSF 2,Mojarra 2.2.4,并且页面中有以下代码:

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:f="http://xmlns.jcp.org/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui"
    xmlns:c="http://java.sun.com/jsp/jstl/core">

    <f:metadata>
        <f:viewAction action="#{sessionBean.solicitud()}" />
    </f:metadata>

    <h:body>
        Solicitud: '#{param.id}'
        From: '#{param.from}'
        <br />
    </h:body>
</html>

The SessionBean has the next method: SessionBean具有下一个方法:

public String solicitud() {
    System.out.println("\n12\n");
    Long id = getRequestParam("id") != null ? Long.valueOf(getRequestParam("id")) : 0;

    String from = getRequestParam("from") != null ? getRequestParam("from") : "";
    System.out.println("*********** PASA POR AQUI 1 ***********************");
    if(id != null && id > 0){
        if(StringUtils.isNotBlank(from) && from.equals("informes")){
            System.out.println("*********** PASA POR AQUI 2 ***********************");
            return solicitud.cargarSolicitudInforme(id);
        }
        else{
            System.out.println("*********** PASA POR AQUI 4 ***********************");
            return solicitud.cargarSolicitud(id);
        }
    }
    else{
        System.out.println("*********** PASA POR AQUI 6 ***********************");
        return home();
    }
}

I changed namepaces xmlns: http://java.sun.com/jsf/core to xmlns: http://xmlns.jcp.org/jsf/core 我将namepaces xmlns: http : //java.sun.com/jsf/core更改为xmlns: http ://xmlns.jcp.org/jsf/core

If I run this application on a VMware vFabric tc Server v2.5, the app runs ok, but if I run it on a Weblogic server, the log doesn´t show error trace but the method is never executed. 如果我在VMware vFabric tc Server v2.5上运行此应用程序,则该应用程序可以正常运行,但是,如果我在Weblogic服务器上运行,则该日志不会显示错误跟踪,但该方法永远不会执行。

what am I doing wrong? 我究竟做错了什么?

Thanx. 谢谢

Solved. 解决了。

The problem was that the default jsf libraries on Weblogic server doesn´t recognize f:viewAction. 问题是Weblogic服务器上的默认jsf库无法识别f:viewAction。 The solution was to include the correct jsf libraries as shared jsf libraries (jsf-impl-2.2.4.jar and jsf-api-2.2.4.jar, in my case) in weblogic_domains/server_name/lib folder and delete them in the deployed war. 解决方案是将正确的jsf库作为共享jsf库(在我的情况下为jsf-impl-2.2.4.jar和jsf-api-2.2.4.jar)包含在weblogic_domains / server_name / lib文件夹中,然后将其删除。展开战争。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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