Tried this but wanted a uniform error.
for /test/test
I get :
Status Code: 404
Message: /ddd/test
Type:
Exception: The file that you requested could not be found on this server
for /test/test.action
Status Code:
Message:
Type:
Exception: The file that you requested could not be found on this server
##
<default-action-ref name="404me" />
<action name="404me">
<result>
<param name="location">/WEB-INF/jsps/errors/404.jsp</param>
<param name="message">"ok"</param>
</result>
</action>
Need to mimic the errors and handle dev mode, so may need an action for
this. Will look into this some more. Thanks.
On 13 September 2017 at 08:42, Yasser Zamani <[email protected]> wrote:
> At [1] there is an answer as below:
>
> > Usually, if an action is requested, and the framework can't map the
> request to an action name, the result will be the usual "404 - Page not
> found" error. But, if you would prefer that an omnibus action handle any
> unmatched requests, you can specify a default action. If no other action
> matches, the default action is used instead.
> >
> > <package name="Hello" extends="action-default">
> >
> > <default-action-ref name="UnderConstruction"/>
> >
> > <action name="UnderConstruction">
> > <result>/UnderConstruction.jsp</result>
> > </action>
> >
> > ...
> > There are no special requirements for the default action. Each package
> can have its own default action, but there should only be one default
> action per namespace.
> >
> > One to a Namespace
> >
> > The default action features should be set up so that there is only one
> default action per namespace. If you have multiple packages declaring a
> default action with the same namespace, there is no guarantee which action
> will be the default.
>
> [1]
> https://struts.apache.org/docs/action-configuration.
> html#ActionConfiguration-ActionDefault
>
> On 9/13/2017 12:09 PM, Greg Huber wrote:
> > For a bogus /test.action I get
> >
> > There is no Action mapped for namespace [/] and action name [test]
> > associated with context path []
> >
> > If not in dev mode, would it not be better to just to a more generic 404
> > not found, rather than a known struts reply?
> >
>