I have a litte weird problem with java spring mvc. When user wants to go "localhost:8080/admin" everything works fine but when user wants to go "localhost:8080/admin/create", all CSS and JS files will be missing.
ADMIN CONTROLLER
@Controller
@RequestMapping(value="/admin")
public class AdminController {
@Autowired
private JobService jobService;
@RequestMapping(path="")
public String index(){
return "admin";
}
@RequestMapping(path = "/create", method = RequestMethod.GET)
public String create(){
return "create";
}
@RequestMapping(path = "/create", method = RequestMethod.POST)
public @ResponseBody String create(@RequestParam String title, @RequestParam String description,@RequestParam int personQuantity, @RequestParam String lastApp) {
Job newJob = new Job();
newJob.setJobTitle(title);
newJob.setJobDescription(description);
newJob.setNumberOfPersonToHire(personQuantity);
newJob.setLastApplicationDate(lastApp);
jobService.create(newJob);
return "admin";
}
}
WEB.XML
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
<display-name>Kodgemisi-HR-Application-master</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>


