Num to conseguindo fazer nem o freemarker nem o velocity funcionar de jeito nenhum.
To usando webwork e queria fazer algum desses 2 funcionar. Já segui vários tutoriais mas nao funciona. Alguém pode me ajudar a configurar?
segue abaixo minhas configurações:
xwork(que tá na webinf/classes):
<!DOCTYPE xwork PUBLIC “-//OpenSymphony Group//XWork 1.0//EN”
“http://www.opensymphony.com/xwork/xwork-1.0.dtd”>
<xwork>
<include file=“webwork-default.xml” />
<package name=“default” extends=“webwork-default”>
<default-interceptor-ref name=“defaultStack” ></default-interceptor-ref>
<action name=“CadastraClienteAction” class=“webwork.action.CadastraClienteAction”>
<result name=“error” type=“dispatcher”>erro.jsp</result>
<result name=“success” type=“dispatcher”>clienteCadastrado.jsp</result>
</action>
<action name=“TesteActionFreemarker” class=“webwork.action.TesteActionFreemarker”>
<result name=“error” type=“dispatcher”>erro.vm</result>
<result name=“success” type=“dispatcher”>testeResult.ftl</result>
</action>
<action name=“AnoNascimento” class=“guia.CalculaAnoNascimento”>
<result name=“error” type=“dispatcher”>leIdade.jsp</result>
<result name=“success” type=“dispatcher”>mostraAno.jsp</result>
</action>
<action name=“TesteVelocityAction” class=“webwork.action.TesteVelocityAction”>
<result name=“error” type=“velocity”>erro.vm</result>
<result name=“success” type=“velocity”>success.vm</result>
</action>
</package>
</xwork>
web.xml que tá na webinf:
<?xml version=“1.0” encoding=“UTF-8”?>
<web-app xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns=“http://java.sun.com/xml/ns/javaee” xmlns:web=“http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd” xsi:schemaLocation=“http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd” id=“WebApp_ID” version=“2.5”>
<display-name>webwork2</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>webwork</servlet-name>
<servlet-class>
com.opensymphony.webwork.dispatcher.ServletDispatcher
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>webwork</servlet-name>
<url-pattern>*.action</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>freemarker</servlet-name>
<servlet-class>
com.opensymphony.webwork.views.freemarker.FreemarkerServlet
</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>freemarker</servlet-name>
<url-pattern>*.ftl</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Velocity</servlet-name>
<servlet-class>org.apache.velocity.servlet.VelocityServlet</servlet-class>
<init-param>
<param-name>properties</param-name>
<param-value>/WEB-INF/velocity.properties</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Velocity</servlet-name>
<url-pattern>*.vm</url-pattern>
</servlet-mapping>
</web-app>
meus arquivos .vm e .jsp estão na webcontents
Se alguém puder ajudar…