English 中文(简体)
JSF 2.0 指挥后导航
原标题:JSF 2.0 Navigation after commandButton

Hello,我正在利用第二份共同基金建立一个网站。

我正试图建立一个指挥区,以便在施加压力后,它用某种方法将它 some到一页,取决于从该方法返回的情况。

直到现在,我才使用2号共同财产法行动导航,但从我看,不可能有两项行动,因此,你必须使用一个面对面的文件。

我尝试制定一条航道规则,但我不能这样做。 我认为,这或许是一个问题,在我的网站上宣布。 我试图保留最初的准值,但该法典不会编纂成文,因此评论:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
    <!--
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
    -->

    <param-name>javax.faces.CONFIG_FILES</param-name> 
  <param-value>/WEB-INF/faces-config.xml</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>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
    <session-timeout>
        30
    </session-timeout>
</session-config>
<welcome-file-list>
    <welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>


<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>

我的面对面文件如下:

<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">

   <navigation-rule> 
<from-view-id>/tabletsHome.xhtml</from-view-id> 
<navigation-case> 
  <from-outcome>product1</from-outcome> 
  <to-view-id>/inputForm.xhtml</to-view-id> 
</navigation-case> 
<navigation-case> 
  <from-outcome>product2</from-outcome> 
  <to-view-id>/inputForm.xhtml</to-view-id> 
</navigation-case> 

在航行将你带至下页后,根据当事人点击的情况,还可以将信息传递给这个网页。 例如,产品编号?

事先感谢你提供的任何帮助。

最佳回答

I m不肯定web.xml/faces-config.xml与这一点有关。 关于您的背景问题,仅创建了另一个<代码><context-param>。 但是,这并没有解决你的问题。 关于你的导航问题,你只有一种能够带来不同结果的单一行动方法。

public String submit() {
    if (...) {
        return "view1";
    }
    else {
        return "view2";
    }
}
问题回答

暂无回答




相关问题
JSF a4j:support with h:selectManyCheckbox

I m having trouble with a JSF selectManyCheckbox and A4J support. The purpose is to run some action when a checkbox is selected. This works perfectly in Firefox. Yet, when testing in any IE (ie6 / ie7 ...

Mojarra for JSF Encoding

Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don t know what to do with

如何拦截要求终止?

在共同基金中,如果用户要求终止,就需要采取一些行动。 我需要某种拦截器,但我不知道如何这样做。 我需要帮助。 增 编

ICEFaces inputFile getting the file content without upload

Is there any way of just getting the content of the browsed file without any upload/file transfer operations? I currently use ICEFaces inputFile component but I do not need the default uploading ...

Weird behaviour of h:commandLink action (MethodExpression)

I have two JSPs where I am displaying some info from database in a h:dataTable. One of them is showing all the info, and one of them user specifically. I have showXML.jsp that shows the "XML" column ...

How to correctly use ResultSet with h:dataTable

The problem is, that after displaying the ResultSet with <h:dataTable>, the connection is left open. If I close it, it closes the ResultSet too. I m thinking about copying the ResultSet data ...

热门标签