I've googled around for this but I couldn't find a clear answer, and i think there is something basic i am just plainly missing here.
I have set up a spring app, fairly straight forward up until this point, having the dispatcher recieve the .htm request and the view resolver has been working correctly mapping it to the correct internal .jsp file within the WEB-INF/jsp/ folder. All is working well with ModelAndView objects also.
However, when I rename the controller's physical file name (and its internal classname to match), + rename the bean's 'class' value my springtest-servlet.xml, I get a:
'WARNING: No mapping found for HTTP request with URI [/springtest/hello.htm] in DispatcherServlet with name 'springtest' during run-time when the mapping is resolved.'
I understand that this is a noob question for spring devs, but what is the way around this without recreating the controller from scratch?
Below are the relevant configuration files if it helps: (server is glassfish)
springtest-servlet.xml
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/jsp/"
p:suffix=".jsp" />
<bean name="indexController"
class="org.springframework.web.servlet.mvc.ParameterizableViewController"
p:viewName="index" />
<bean name="/hello.htm" class="springtest.web.InventoryController"/>
web.xml
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>springtest</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springtest</servlet-name>
<url-pattern>*.htm</url-pattern></servlet-mapping>
springtest.web.InventoryController.java
public class InventoryController implements Controller
{
protected final Log logger = LogFactory.getLog(getClass());
@Override
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String now = (new Date()).toString();
return new ModelAndView("hello", "now", now);
}
}
Any advice would be greatly appreciated,
Thanks