I am not an expert but what I would do for this is create an action with a wildcard that should work like a "default" option in a "switch/select case".
something like <action name="first" class="go"> <result>go.jsp</result> </action> <action name="second" class="go2"> <result>go2.jsp</result> </action> <!-- several actions later --> <action name="*" class="NoActionMappedAction"> <result>NoActionMappedGO.jsp</result> </action> On Tue, Apr 20, 2010 at 15:19, Bhaarat Sharma <bhaara...@gmail.com> wrote: > in struts2 is there a way to detect when "No action mapped for namespace > ..." error will come up?? > > What I mean is that can we write an if condition that checks whether or not > the the action name exists in struts.xml? > > we can get the action name by: ActionContext.getInstance().getName() > > So if the above line of code returns an action name...can it > be guaranteed that we will not get "No action mapped for namespace..."? > > Thanks > -- Ing. Luis Martín Canaval Sánchez Keep it small and simple.