I am building an web app using Spring MVC3 and Tiles3.. but I am getting some problem for loading static resource.
In web.xml I have the following code:
<filter>
<filter-name>static-filter</filter-name>
<filter-class>com.app.common.filter.DefaultFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>static-filter</filter-name>
<url-pattern>/js/*</url-pattern>
<url-pattern>/jsp/*</url-pattern>
<url-pattern>/css/*</url-pattern>
<url-pattern>/images/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>enlightened</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>enlightened</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/index.html</welcome-file>
</welcome-file-list>
The DefaultFilter.java is like:
public class DefaultFilter implements Filter {
private RequestDispatcher defaultRequestDispatcher;
public void destroy() {}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
defaultRequestDispatcher.forward(request, response);
}
public void init(FilterConfig filterConfig) throws ServletException {
this.defaultRequestDispatcher = filterConfig.getServletContext()
.getNamedDispatcher("default");
}
}
And My Folder structure is like:
WebContent --
--- css/ all css files
--- js / all js files
--- images / all images
--- jsp /
-- WEB-INF
index.html
first I am getting the index.html correctly: by the link
http://myserver.com:8080/enlightened/index.html
in index.html i have:
<table>
<tr>
<td><a href="home.html">Sign up!</a></td>
</tr>
</table>
in my controller I have a method for the RequestMapping = /home
@RequestMapping("/home")
public String welcome() {
System.out.println("/home.htm");
return "welcome";
}
but I am not getting the flow in my controller when the
is clicked
Please help..