Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Warum funktionieren meine Navigation-rules nicht?

Empfohlene Antworten

Veröffentlicht

Hallo,

ich möchte gerne ein wenig mit JSF arbeiten. Aber meine Navigation-Rules funktionieren nicht alle. Einen Fehler kann ich nicht finden.

Hier ist meine faces-config.xml:


	<navigation-rule>

		<description>List of cultures</description>

		<from-view-id>/index.jsp</from-view-id>

		<navigation-case>

			<from-outcome>editCulture</from-outcome>

			<to-view-id>/edit.jsp</to-view-id>

		</navigation-case>

		<navigation-case>

			<from-outcome>addCulture</from-outcome>

			<to-view-id>/add.jsp</to-view-id>

		</navigation-case>

	</navigation-rule>


	<navigation-rule>

 		<description>Edit a cultures</description>

 		<from-view-id>/edit.jsp</from-view-id>

 		<navigation-case>

 			<from-outcome>listCultures</from-outcome>

 			<to-view-id>/index.jsp</to-view-id>

 			<redirect/>

 		</navigation-case>

 	</navigation-rule>


 	<navigation-rule>

 		<description>Add a cultures</description>

 		<from-view-id>/add.jsp</from-view-id>

 		<navigation-case>

 			<from-outcome>listCultures</from-outcome>

 			<to-view-id>/index.jsp</to-view-id>

 			<redirect/>

 		</navigation-case>

 	</navigation-rule>

Hier ist meine add.jsp:

	<%@ page language="java" %>

	<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

	<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>


	<f:view>

		<h:form>

			<h:messages />

			<h:outputText value="Neue Kultur eingeben" />

	 		<!--<h:inputHidden id="id" value="#{culture.cultureId}"/>-->

	 		<h:panelGrid columns="2" border="1">


		 		<h:outputText value="Kulturname:" />

		 		<h:inputText id="cultureName" value="#{culture.cultureName}">

					<f:validateLength minimum="2" maximum="30" />

		 		</h:inputText>


	 		</h:panelGrid>


	 		<h:commandButton value="Speichern" action="listCultures"  

	 			actionListener="#{culture.addCulture}" />

	 	</h:form>

	 </f:view>

Von index.jsp zu add.jsp bzw. edit.jsp funktionieren die Navigation-Rules, nur von add.jsp bzw. edit.jsp zu index.jsp nicht.

Sieht jemand den Fehler?

ist die index.jsp in dem gleichen ordner wie die add.jsp?

Ja, sie sind in demselben Ordner.

Falls mal jemand vor dem gleichen Problem stehen sollte, ich habe die Lösung gefunden:

Es lag am <redirect />. Wenn das weg ist, funktionieren die Nagivationrules. In einem Beispiel habe ich das gefunden, deswegen habe ich darüber nicht mehr weiter nachgedacht.

Also das ist die Lösung.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.