I am still lost on these annotations. 
My controller class:
Code:
package org.aero.tcs.add.spring2;
import org.aero.tcs.add.spring2.service.ProductManager;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class InventoryController {
protected final Log logger = LogFactory.getLog(getClass());
private ProductManager productManager;
@RequestMapping("/jsp/hello.jsp")
public void handleHello() {
String now = (new Date()).toString();
logger.info("returning hello view " + now);
Map<String, Object> myModel = new HashMap<String, Object>();
myModel.put("now", now);
myModel.put("products", this.productManager.getProducts());
}
public void setProductManager(ProductManager productManager) {
this.productManager = productManager;
}
}
My dispatcher:
Code:
<?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"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<context:component-scan base-package="org.aero.tcs.add.spring2.service"/>
<bean id="productManager" class="org.aero.tcs.add.spring2.service.SimpleProductManager">
<property name="products">
<list>
<ref bean="product1"/>
<ref bean="product2"/>
<ref bean="product3"/>
</list>
</property>
</bean>
<bean id="product1" class="org.aero.tcs.add.spring2.domain.Product">
<property name="description" value="Lamp"/>
<property name="price" value="5.75"/>
</bean>
<bean id="product2" class="org.aero.tcs.add.spring2.domain.Product">
<property name="description" value="Table"/>
<property name="price" value="25.50"/>
</bean>
<bean id="product3" class="org.aero.tcs.add.spring2.domain.Product">
<property name="description" value="Chair"/>
<property name="price" value="18.50"/>
</bean>
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="messages"/>
</bean>
<bean name="/hello.htm" class="org.aero.tcs.add.spring2.InventoryController">
<property name="productManager" ref="productManager"/>
</bean>
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>
<bean id="configurationLoader" class="org.springmodules.validation.bean.conf.loader.annotation.AnnotationBeanValidationConfigurationLoader"/>
<bean id="validator" class="org.springmodules.validation.bean.BeanValidator"
p:configurationLoader-ref="configurationLoader"/>
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property>
<property name="prefix" value="/WEB-INF/jsp/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
</beans>
I try to run index.jsp, which has a redirect:
Code:
<c:redirect url="/hello.htm" />
My WEB-INF/jsp/hello.jsp should come up, no? When I test it, all I get is "resource () is unavailable". I assume this means I have some mapping wrong.
Any ideas?
Thanks,
Ginni