Pessoal estou tentando fazer um Hello World com o Spring mas esta muito estranho.
Dem uma olhada:
web.xml....
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>applicationContext*.xml</param-value>
</context-param>
<taglib>
<taglib-uri>jstl/displaytag</taglib-uri>
<taglib-location>/WEB-INF/displaytag-el.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>jstl/c</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
......
Meu HelloSpringControle.java
...
public class HelloSpringController implements org.springframework.web.servlet.mvc.Controller{
private String hello;
public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
return new ModelAndView("helloView","message",hello);
}
public void setHello(String hello) {
this.hello = hello;
}
.....
....
<bean name="/helloView.html" class="app.HelloSpringController">
<property name="hello">
<value>Bem vindo</value>
</property>
</bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass">
<value>org.springframework.web.servlet.view.JstlView</value>
</property>
<property name="prefix"><value></value></property>
<property name="suffix"><value>.jsp</value></property>
</bean>
....
e meu helloView.jsp
<%@ taglib uri="jstl/c" prefix="c" %>
<%@ include file="taglibs.jsp"%>
<%@ taglib uri="jstl/displaytag" prefix="display" %>
<title>Hello Spring</title>
${message}
${teste}
<%
out.print("teste");
%>
o resultado é este:
${message} ${teste} teste
Alguem sabe me dizer o porque esta acontecendo isto???
Detalhe: eu olhei o log e esta normal