I recently built a basic RESTful service using Resteasy and JAXRS in Java. I am now attempting to access this service from the front-end using AngularJS $http.get.
Interestingly, I am running this on Tomcat 7.
However, I seem to be encountering an issue where my current web.xml does not allow me to access the AngularJS view, resulting in a 404 error. On the other hand, if I include a simple default web.xml file, the restful service stops working but the AngularJS view becomes accessible.
I have been trying to troubleshoot this for hours, but cannot figure out what's causing the problem. Can anyone provide some insight?
Below is my pom.xml configuration:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>angular-js</groupId>
<artifactId>angular-js</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
(More project properties...)
</project>
This is my web.xml setup:
<?xml version="1.0" encoding="ISO-8859-1" ?>
(Web application configuration details...)
And here is a snippet from my AngularJS code:
(AngularJS controller and routing configurations...)
Finally, my index.htm structure looks like this:
(HTML content with script references...)
In addition, my view1.html contains a simple div container displaying a dynamic value.
If you need more information, please refer to my project structure here.
Thank you for your assistance!