Не найдено сопоставление для HTTP-запроса на Js и CSS. Я в файле jsp, не знаю почему, потому что в прошлом код был в порядке, так как я добавлял в него AppConfig, и тогда это происходило. Я новая весна MVC не знаю, как это исправить, XML хорошо, потому что я тестирую другой проект, но когда добавить config.java, то erorr
весна веб-config.xml
<context:component-scan base-package="org.planning.net" />
<context:component-scan base-package="org.planning.net.controllers" annotation-config="true"/>
<context:component-scan base-package="org.planning.net.service" annotation-config="true"/>
<context:component-scan base-package="org.planning.net.logic" annotation-config="true"/>
<context:component-scan base-package="org.planning.net.dao" annotation-config="true"/>
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<mvc:resources mapping="/resources/**" location="/resources/"/>
<!-- Spring Component -->
<context:annotation-config />
<mvc:default-servlet-handler/>
</beans>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<element>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.1">
<display-name>Net</display-name>
<!-- For web context -->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-web-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-web-config.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- For root context -->
<!--
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-core-config.xml</param-value>
</context-param>
-->
</web-app>
</element>
AppConfig.java
@SingletonConfig
@Configuration
@Component
@EnableWebMvc
@ImportResource({"classpath:get-bean-name.xml"})
public class AppConfig implements Config {
private static final AppConfig INSTANCE = new AppConfig();
private Dialect dialect;
private LocalTransactionDataSource dataSource;
private TransactionManager transactionManager;
private AppConfig() {
dialect = new MysqlDialect();
dataSource = new LocalTransactionDataSource("jdbc:jtds:sqlserver://localhost:1433/NetDatabase;instance=SQLEXPRESS", "ccc", "1");
transactionManager = new LocalTransactionManager(dataSource.getLocalTransaction(getJdbcLogger()));
}
@Override
public Dialect getDialect() {
return dialect;
}
public DataSource getDataSource() {
return dataSource;
}
public TransactionManager getTransactionManager() {
return transactionManager;
}
public static AppConfig singleton() {
return INSTANCE;
}
@Override
public int getBatchSize() {
// TODO Auto-generated method stub
return 0;
}
@Override
public ClassHelper getClassHelper() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getDataSourceName() {
// TODO Auto-generated method stub
return null;
}
@Override
public ExceptionSqlLogType getExceptionSqlLogType() {
// TODO Auto-generated method stub
return null;
}
@Override
public int getFetchSize() {
// TODO Auto-generated method stub
return 0;
}
@Override
public JdbcLogger getJdbcLogger() {
// TODO Auto-generated method stub
return new Slf4jJdbcLogger();
}
@Override
public int getMaxRows() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getQueryTimeout() {
// TODO Auto-generated method stub
return 0;
}
@Override
public RequiresNewController getRequiresNewController() {
// TODO Auto-generated method stub
return null;
}
@Override
public SqlFileRepository getSqlFileRepository() {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean ignoreUnknownColumn() {
// TODO Auto-generated method stub
return false;
}
}