Hi,

I am posting a question here which I have already tried on the user  
list, but it seems others may have also seen this behavior but not  
know a solution:

I am trying to get the event name by calling getEventName() on the  
ActionBeanContext from my default handler, but it always seems to  
return "defaultHandler" regardless of the original event.

For example in the following extract the String event will always be  
"defaultHandler" reagreless of the event 'name' in the calling jsp page.

public class MyHandlerActionBean implements ActionBean {
    private ActionBeanContext context;
.
.
.

    @DefaultHandler
    public Resolution defaultHandler() {
        
        String event = context.getEventName();
     }
}

I think from an earlier discussion (much earlier in 2006...) that this  
should work intuitively and return the original event name:

"Another nice change is that as long as an event has a name, even if  
it is invoked as the default, calling ActionBeanContext.getEvent()  
will return you the correct event name. " (from Subject: Re: [Stripes- 
dev] ValidationErrors - msg#00188 List: java.stripes.devel)

Is anyone aware of this issue and is there any workaround (or am I  
doing something wrong above)?

One additional question that came up as I made some changes to  
workaround the above issue by looking at the parameters in the HTTP  
request itself: I noticed that a Stripe link seems to put the event  
value as a parameter name rather than a parameter value in the HTTP  
request. For example for the following link:

<li><stripes:link event="clickRegistration"  
beanclass="myWebApp.myLinkHandlerActionBean">stripes Link</ 
stripes:link></li>

'clickRegistration' will be a parameterName, rather than a value for a  
parameter - i.e. you will find it by using request.getParameterNames()  
rather than request.getParameter("some-meaningful-name-for-the-event- 
parameter");

Is this intentional (or necessary because of HTTP link request  
limitations) ?

Cheers,

Mick


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to