I got a problem when developing spring project. I am getting warnings after returning from the controller. This is the configuration
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://ift.tt/ra1lAU"
xmlns="http://ift.tt/nSRXKP" xmlns:web="http://ift.tt/LU8AHS"
xsi:schemaLocation="http://ift.tt/nSRXKP http://ift.tt/1eWqHMP"
id="WebApp_ID" version="3.0">
<display-name>PolavaramWebApp</display-name>
<welcome-file-list>
<welcome-file>jsp/index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>polavaram</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/polavaram-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>polavaram</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- Default mapping for css and js and img folders -->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/img/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/css/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/js/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/fonts/*</url-pattern>
</servlet-mapping>
From the index.jsp I am calling this controller
@Controller
@RequestMapping("/polavaram")
public class LoginController implements ServletContextAware {
private ServletContext servletContext;
@Override
public void setServletContext(ServletContext servletCtx) {
this.servletContext = servletCtx;
}
@RequestMapping(value = "/login", method = RequestMethod.GET)
public ModelAndView login() {
return new ModelAndView("loginpage");
}
This is my tiles configuration
<definition name="loginpage" extends="baseLayout">
<put-attribute name="title" value="Login Page" />
<put-attribute name="body" value="/jsp/loginpage.jsp" />
</definition>
This is the warning I am getting 00:16:04,849 WARN PageNotFound:1120 - No mapping found for HTTP request with URI [/PolavaramWebApp/polavaram/js/bootstrap.js] in DispatcherServlet with name 'polavaram'
I have this folder structure
webapp
css
jsp
js
img
There are some libraries in them. I am not able to access them in the loginpage.jsp
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:ApplicationResources.properties</value>
<value>classpath:database.properties</value>
<value>classpath:dbqueries.properties</value>
</list>
</property>
<property name="ignoreUnresolvablePlaceholders" value="true" />
</bean>
<!-- <mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/employee/*"
/> <mvc:mapping path="/course/*" /> <mvc:mapping path="/sessionplan/*" />
<mvc:mapping path="/registration/*" /> <mvc:mapping path="/tms/logout"/>
<mvc:mapping path="/faculty/*"/> <mvc:mapping path="/course/*"/> <bean class="in.walamtari.tms.interceptor.AuthenticationInterceptor"
/> </mvc:interceptor> </mvc:interceptors> -->
<context:annotation-config />
<context:component-scan
base-package="in.gov.polavaram.controller,in.gov.polavaram.manager,in.gov.polavaram.dao" />
<bean id="tilesViewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass">
<value>
org.springframework.web.servlet.view.tiles2.TilesView
</value>
</property>
</bean>
<bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/tiles.xml</value>
</list>
</property>
</bean>
<bean id="jspViewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:ApplicationResources" />
</bean>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${psql.jdbc.driverClassName}" />
<property name="url" value="${psql.jdbc.url}" />
<property name="username" value="${psql.jdbc.username}" />
<property name="password" value="${psql.jdbc.password}" />
</bean>
<!-- <bean id="dataSource_hrms" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${psqlhrms.jdbc.driverClassName}"
/> <property name="url" value="${psqlhrms.jdbc.url}" /> <property name="username"
value="${psqlhrms.jdbc.username}" /> <property name="password" value="${psqlhrms.jdbc.password}"
/> </bean> -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- setting maximum upload size -->
<property name="maxUploadSize" value="5000000" />
</bean>
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
<!-- <mvc:interceptors>
<bean class="in.gov.jalabharati.interceptor.AuthenticationInterceptor" />
</mvc:interceptors> -->
</beans>
Aucun commentaire:
Enregistrer un commentaire