struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Pratt" <>
Subject [S2] Default Action
Date Thu, 05 Jul 2007 06:56:01 GMT
I am trying to figure out how to set the default class that is executed when
a class is not specified on an <action> declaration.  When you specify
something like:

<action name="home">

Struts automatically runs com.opensymphony.xwork2.ActionSupport.  But I am
trying to figure out how to accomplish this:

<action name="home">
  <param name="role">user</param>

Since ActionSupport doesn't have a setRole method, this won't work out of
the box, so I created a simple extension of ActionSupport to hold the role
value.  After a bit of googling, I got the idea that this should work:

<action name="default" class="my.package.BaseAction"/>

<default-action-ref name="default"/>

but that doesn't seem to do the job.  Is it possible?  Is there another way
to specify this type of information on a per Action basis?  Any insights
would be appreciated.

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