i spend a few hours fighting with my problem, but with no big result, maybe someone will help me :)
My project look like this:
I want to use a library to draw a chart from this tutorial: FusionCharts
I got error message this:
09-Jan-2018 21:56:22.304 WARNING [http-nio-8080-exec-1] org.springframework.web.servlet.PageNotFound.noHandlerFound No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'spring' 09-Jan-2018 21:56:22.323 WARNING [http-nio-8080-exec-3] org.springframework.web.servlet.PageNotFound.noHandlerFound No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'spring' 09-Jan-2018 21:56:22.465 WARNING [http-nio-8080-exec-5] org.springframework.web.servlet.PageNotFound.noHandlerFound No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'spring'
Files FusionCharts, fusioncharts.charts.js and fusioncharts.js are from library.
Home Controller Code:
package com.charts.controller;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
public class HomeController implements Controller {
@Override
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
return new ModelAndView("index");
}
public String chartmaker(){
FusionCharts lineChart = new FusionCharts (
"line",// chartType
"chart1",// chartId
"600","350",// chartWidth, chartHeight
"chart",// chartContainer
"jsonurl",// dataFormat
"data.json"
);
return lineChart.render();
}
}
index.jsp:
<%@ page import="com.charts.controller.HomeController" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="com.charts.controller.FusionCharts" %>
<!DOCTYPE html>
<html>
<head>
<title>FusionCharts || www.fusioncharts.com</title>
<script src="../fusioncharts.js"></script>
<script src="../fusioncharts.charts.js"></script>
<script src="../fusioncharts.theme.fint.js"></script>
</head>
<body>
<div id="chart"></div>
<%
HomeController a = new HomeController();
out.println(a.chartmaker());
%>
</body>
</html>
spring-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<bean id="HandlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" />
<bean id="/welcome.html" class="com.charts.controller.HomeController" />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
<property name="prefix">
<value>/WEB-INF/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
</beans>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/spring-servlet.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
When i run a project, i got this message:

When i go to the http://localhost:8080/welcome.html i got a clear screen and this library doesn't draw any chart or something like that.
My configuration files are properly like web.xml or spring-servlet.xml ? I will be grateful for any advices
Regards, Adrian
