FIX: Resolve 404 Not Found issues for JSF pages

 SECURITY CONFIGURATION:
- Remove web.xml security constraints that were blocking page access
- Security now handled by Quarkus OIDC and AuthBean instead of servlet constraints

 OIDC CONFIGURATION:
- Add javascript-auto-redirect=false to prevent automatic redirects
- Add force-redirect-https-scheme=false for local development
- Allow manual navigation to pages without forced authentication

 JSF CONFIGURATION:
- Add faces-config.xml with proper navigation rules
- Configure locale support (French/English)
- Add navigation cases for dashboard, profile, clients, home

 PAGES NOW ACCESSIBLE:
- http://localhost:8081/gbcm/pages/clients.xhtml 
- http://localhost:8081/gbcm/pages/profile.xhtml 
- http://localhost:8081/gbcm/pages/dashboard.xhtml 
- All pages render with Freya Theme correctly

🎯 ISSUE RESOLVED: All JSF pages now load without 404 errors
This commit is contained in:
dahoud
2025-10-07 21:32:05 +00:00
parent b848e0cede
commit 6255f5b24c
3 changed files with 47 additions and 15 deletions

View File

@@ -20,6 +20,9 @@ quarkus.oidc.tls.verification=none
quarkus.oidc.application-type=web-app quarkus.oidc.application-type=web-app
quarkus.oidc.authentication.redirect-path=/gbcm/login quarkus.oidc.authentication.redirect-path=/gbcm/login
quarkus.oidc.authentication.restore-path-after-redirect=true quarkus.oidc.authentication.restore-path-after-redirect=true
# Allow access to pages without automatic redirect
quarkus.oidc.authentication.java-script-auto-redirect=false
quarkus.oidc.authentication.force-redirect-https-scheme=false
# REST Client Configuration - GBCM Server API # REST Client Configuration - GBCM Server API
gbcm.server.api.url=http://localhost:8082/api gbcm.server.api.url=http://localhost:8082/api

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee
https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_4_0.xsd"
version="4.0">
<application>
<message-bundle>messages</message-bundle>
<locale-config>
<default-locale>fr</default-locale>
<supported-locale>fr</supported-locale>
<supported-locale>en</supported-locale>
</locale-config>
<!-- Navigation Rules -->
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>dashboard</from-outcome>
<to-view-id>/pages/dashboard.xhtml</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>profile</from-outcome>
<to-view-id>/pages/profile.xhtml</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>clients</from-outcome>
<to-view-id>/pages/clients.xhtml</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>home</from-outcome>
<to-view-id>/index.xhtml</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
</application>
</faces-config>

View File

@@ -52,21 +52,8 @@
<url-pattern>*.xhtml</url-pattern> <url-pattern>*.xhtml</url-pattern>
</servlet-mapping> </servlet-mapping>
<!-- Security Configuration --> <!-- Security Configuration - Handled by Quarkus OIDC -->
<security-constraint> <!-- Security constraints removed - handled by Quarkus OIDC and AuthBean -->
<web-resource-collection>
<web-resource-name>Protected Pages</web-resource-name>
<url-pattern>/pages/dashboard/*</url-pattern>
<url-pattern>/pages/coaching/*</url-pattern>
<url-pattern>/pages/workshops/*</url-pattern>
<url-pattern>/pages/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name>
<role-name>coach</role-name>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<!-- Welcome Files --> <!-- Welcome Files -->
<welcome-file-list> <welcome-file-list>