Issue Summary
I am encountering a problem with the deployment and routing of my Angular application in Apache Tomcat. When deploying the application in the Tomcat web apps directory and changing the base
tag in index.html
, I face issues with refreshing the page and navigating to components in separate windows.
Expected Behavior
I expect the application to load correctly, and routing should work seamlessly, even when refreshing the page or opening components in separate windows.
Actual Behavior
The application encounters issues with 404 errors on refresh, and components sometimes open in separate windows with incorrect URLs. Adding the { useHash: true }
configuration in routing resolves the refresh issue but introduces navigation problems.
Additional Information
- Angular CLI version: 16
- Angular version: 16
- Deployment Environment: Apache Tomcat
I am open to alternative solutions that do not involve using the hash strategy in routing. Please provide guidance on the recommended approach for deploying Angular applications in Apache Tomcat without encountering these routing issues.