struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luis Martín Canaval Sánchez <martin.cana...@gmail.com>
Subject Re: no action mapped for namespace
Date Tue, 20 Apr 2010 23:40:43 GMT
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 <bhaarat.s@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.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message