从jsp-jsf传递值 [英] pass values from jsp-jsf

查看:58
本文介绍了从jsp-jsf传递值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<h:dataTable id="dt1" value="#{Student.stuList}" var="stuList" bgcolor="#F1F1F1">

            <h:column>
                <f:facet name="header">
                    <h:outputText style=""value="Stu Number" />
                </f:facet>
                <h:outputText style="" value="#{stuList.stuNumber}"></h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value=" Date"/>
                </f:facet>
                <h:outputText value="#{stuList.date}">
                    <f:convertDateTime type="date" pattern="dd-MM-yyyy"/></h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="English"/>
                </f:facet>
                <h:outputText value="#{stuList.english}"></h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Maths"/>
                </f:facet>
                <h:outputText value="#{stuList.maths}"></h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Science"/>
                </f:facet>
                <h:outputText value="#{stuList.science}"></h:outputText>
            </h:column>                    
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Student History"/>
                </f:facet>
             <h:form>
               <h:commandLink id = "historyBtn" value="Student History" action="#{stuBean.showHistory}">
                 <f:param name="stuNumber" value="#{stuBean.stuNumber}" />
               </h:commandLink></h:form>
            </h:column>
        </h:dataTable>

我尝试使用上面的代码传递参数,但出现以下错误:

I've tried passing the parameters using the above code and I'm getting the following error:

org.apache.catalina.core.StandardWrapperValve调用 严重:Servlet Faces Servlet的Servlet.service()抛出异常 java.lang.NullPointerException

org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet Faces Servlet threw exception java.lang.NullPointerException

推荐答案

在Web上进行R和D操作后,摄像头知道我们不需要在<h:commandButton><h:commandLink>

After my R and D on web...cam to know that we dont need to pass input parameters on <h:commandButton> or <h:commandLink>

我也尝试每次刷新列表,使其工作.. !!

also I tried to refresh the list each time thus it worked..!!

这篇关于从jsp-jsf传递值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆