Hello,
===============
My web.xml:
===============
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Glop</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</
filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
</web-app>
===============
My struts.xml:
===============
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<!-- Configuration for the default package. -->
<package name="default" extends="struts-default">
<action name="workOnOrder" class="com.experiment.MyOrderAction">
<result name="error" type="freemarker">/support/error.ftl</result>
</action>
</package>
</struts>
===============
My Action class
===============
@Validation
public class MyOrderAction extends ActionSupport
{
private String orderNumber;
public String execute()
{
// do some stuff here
return NONE;
}
public void setOrderNumber(String orderNumber)
{
this.orderNumber = orderNumber;
}
@RequiredStringValidator(message = "Order number is required.")
public String getOrderNumber()
{
return this.orderNumber;
}
}
===============
Problem:
===============
http://mydomain/glop/workOnOrder.action?orderNumber=123456
Accessing the above url does what is intended.
On the other hand,
http://mydomain/glop/workOnOrder.action
Throws an error, but struts does not take the user to /support/
error.ftl page
Basically, I want to render the error.ftl page on validation failure.
Is this possible? What am I missing?
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]