struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <ahardy.str...@cyberspaceroad.com>
Subject Re: Cancel button not working?
Date Wed, 09 Jul 2003 15:54:55 GMT
Via logging is basically how I solved it - by figuring out where in 
struts I was going wrong.

What it means now is that RequestProcessor is not setting that attribute 
- you don't need to set it by hand, struts should.

It's just one little if clause. According to your logging, 
request.getParameter("org.apache.struts.taglib.html.CANCEL") has a 
value, right? The parameter is not null?

If the parameter is not null but the attribute is null, that means that 
you have either not got the same struts code as me (1.1 final) or your 
RequestProcessor is not executing the processPopulate() method.

I would check 2 things:

that org.apache.struts.taglib.html.Constants.CANCEL_PROPERTY == 
"org.apache.struts.taglib.html.CANCEL"  (i.e. that the parameter name / 
cancel button name in your HTML is correct)

and that RequestProcessor.processPopulate() is executing. This method 
also puts the data into the action form, so you could use that as a 
check unless you can grab the source code and put some logging in there.

As you can tell I'm intrigued.
Adam

Sashi Ravipati wrote:
> request.getAttribute(Globals.CANCEL_KEY) is returning null, so can I set
> it to not null and where Should I do this..
> 
> Can u explain how u solved ur problem..
> 
> Thanks
> 
> 
>>>>ahardy.struts@cyberspaceroad.com 07/09/03 11:22AM >>>
> 
> I've solved my problem. Now you've checked the parameter, check to see 
> if the request.attribute is set with
> request.getAttribute(Globals.CANCEL_KEY);
> 
> For some reason in the RequestProcessor it sets this attribute to true 
> when the request.parameter is present. Check it out. This is the one 
> that the Action.isCancelled() checks. It has to be not null.
> 
> 
> Adam
> 
> Sashi Ravipati wrote:
> 
>>it says - Cancel 
>>
>>I don't know what I am missing which is making this tag not work..
>>
>>Thanks
>>
>>
>>
>>
>>
>>>>>ahardy.struts@cyberspaceroad.com 07/09/03 09:50AM >>>
>>
>>Try logging what is in this cancel parameter 
>>(org.apache.struts.taglib.html.CANCEL) in the same place where you are
> 
> 
>>calling isCancelled()
>>
>>Actually I've just realised I'm suffering the same problem. I'll try
> 
> it 
> 
>>myself. Let me know what you find as well!
>>
>>Adam
>>
>>Sashi Ravipati wrote:
>>
>>
>>>HTML is as shown below
>>>
>>> <input type="submit" name="org.apache.struts.taglib.html.CANCEL"
>>>value="Cancel" onclick="bCancel=true;">
>>>
>>>>>>ahardy.struts@cyberspaceroad.com 07/09/03 09:21AM >>>
>>>
>>>Sashi, what HTML does the tag produce?
>>>
>>>Adam
>>>
>>>Sashi Ravipati wrote:
>>>
>>>
>>>
>>>>I am trying this on Struts 1.1 final. Will this make any difference..
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>>>mruppin@yahoo.com 07/08/03 05:11PM >>>
>>>>
>>>>Odd, I can't reproduce that in 1.1-rc1.  Unless you're
>>>>extending something which might override the
>>>>isCancelled(HttpServletRequest) method, or the
>>>>html:cancel tag is not contained within an html:form
>>>>tag, I can't think of anything else.
>>>>
>>>>m
>>>>
>>>>--- Sashi Ravipati <RavipatiS@michigan.gov> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>This is how I have my cancel tag.
>>>>>
>>>>><html:cancel>
>>>>>     <bean:message key="button.cancel"/>
>>>>></html:cancel>
>>>>>
>>>>>>>>mruppin@yahoo.com 07/08/03 02:27PM >>>
>>>>>
>>>>>The complete content of your html:cancel tag is
>>>>>probably key to solving this problem.
>>>>>
>>>>>m
>>>>>
>>>>>--- Sashi Ravipati <RavipatiS@michigan.gov> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>isCancelled(request) is always returning false
>>>>>>(Even when cancel button
>>>>>>is clicked)
>>>>>>
>>>>>>Need some help...
>>>>>>
>>>>>>Thanks
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>>>RavipatiS@michigan.gov 07/08/03 09:10AM >>>
>>>>>>
>>>>>>I have a <html:cancel> in my jsp page. and in my
>>>>>>action I have
>>>>>>
>>>>>>if(isCancelled(request)){
>>>>>>   return mapping.findForward("index"); 
>>>>>>}
>>>>>>
>>>>>>
>>>>>>But it is not working. What am I doing wrong here.
>>>>>
>>>>>I
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>am using Struts 1.1
>>>>>>final
>>>>>>
>>>>>>Thanks
>>>>>>
>>>>>
>>>>>
>>>>>__________________________________
>>>>>Do you Yahoo!?
>>>>>SBC Yahoo! DSL - Now only $29.95 per month!
>>>>>http://sbc.yahoo.com
>>>>>
>>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>
>>>>
>>>>
>>>>
>>>>>To unsubscribe, e-mail:
>>>>>struts-user-unsubscribe@jakarta.apache.org
>>>>>For additional commands, e-mail:
>>>>>struts-user-help@jakarta.apache.org
>>>>>
>>>>
>>>>
>>>>
>>>>__________________________________
>>>>Do you Yahoo!?
>>>>SBC Yahoo! DSL - Now only $29.95 per month!
>>>>http://sbc.yahoo.com
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message