小编umi*_*lic的帖子

Nibabel库中的get_data和get_fdata有什么区别?

我正在与 Nibabel 一起阅读一些 .nii 文件。我遇到了不同的示例,其中一些使用 get_data() 函数,而另一些则使用 get_fdata() 函数。我找不到他们的文档(nibabel manuel)中有什么区别。谁能解释一下吗?

提前致谢。

python nifti nibabel

7
推荐指数
1
解决办法
6047
查看次数

#{bean.function}和#{bean.function()}有什么区别?

我是JSF的新手.我想知道JSF /导航规则的一点.我有四个页面,索引,p1,p2,p3.当我尝试导航到一个页面,其中action ="#{bean.gotoP1()} ",这是错误的;

"无法找到与from-view-id'/index.xhtml'匹配的导航案例,以便对行动'#{bean.gotoP1()}'结果'成功'"

我的问题很简单; 为什么我不能用#{bean.gotoP1()}导航,我必须删除括号#{bean.gotoP1}?

我的代码在下面;

的index.xhtml

<h:body>    
    <h:form>
        <h:commandButton action="#{mybean.gotoP1()}" value="P1"/>
        <h:commandButton action="#{mybean.gotoP2()}" value="P2"/>
        <h:commandButton action="#{mybean.gotoP3()}" value="P3"/>
    </h:form>
</h:body>
Run Code Online (Sandbox Code Playgroud)

mybean.java

@ManagedBean
@RequestScoped
public class Mybean implements Serializable{

    private static final long serialVersionUID=1L;

    public Mybean() {
    }

    public String gotoP1(){
        return "success";
    }

    public String gotoP2(){
        return "success";
    }

    public String gotoP3(){
        return "positive";
    }
}
Run Code Online (Sandbox Code Playgroud)

faces-config.xml中

<navigation-rule>
    <from-view-id>/index.xhtml</from-view-id>

    <navigation-case>
        <from-action>#{mybean.gotoP1}</from-action>
        <from-outcome>success</from-outcome>
        <to-view-id>/p1.xhtml</to-view-id>
    </navigation-case>

    <navigation-case>
        <from-action>#{mybean.gotoP2}</from-action>
        <from-outcome>success</from-outcome>
        <to-view-id>/p2.xhtml</to-view-id>
    </navigation-case>

    <navigation-case>
        <from-action>#{mybean.gotoP3}</from-action>
        <from-outcome>positive</from-outcome>
        <to-view-id>/p3.xhtml</to-view-id>
    </navigation-case>
</navigation-rule>
Run Code Online (Sandbox Code Playgroud)

谢谢....

navigation jsf jsf-2

2
推荐指数
1
解决办法
187
查看次数

标签 统计

jsf ×1

jsf-2 ×1

navigation ×1

nibabel ×1

nifti ×1

python ×1