Thanks, Carlos,

The difficulty in getting the page up had rather overshadowed any discussion of what they say. I have quite a lot yet to add to the page. I would indeed appreciate any efforts to assist. Be my guest.

Michael McGrady

Carlos Cajina - Hotmail wrote:

I'll sure be waiting for them Mr. McGrady :^)  Thanks for your time! By the
way, I'll be glad to help out with "polishing" the page, if there's anything
I can do please let me know; the solutions proposed are worth the effort of
a good documentation...

----- Original Message ----- From: "Michael McGrady" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, September 24, 2004 12:17 PM
Subject: Re: [HOW TO? ImageButtonBeanManager Extension]





Answers to your other questions to follow in a bit, Carlos.

Carlos Cajina - Hotmail wrote:



Good morning.

Thanks to Mr. McGrady for his suggestion. I think the persistent nature


of


the need to handle multiple (image) buttons in web applications is


precisely


what makes this problem so recurrent ;^)
I've moved from the 'ImageButtonBeanManager Extension' approach and


decided


to try to get SOLUTION TWO up & running but I've ran into a few problems


and


thought that maybe you could spare some time to help me out.

Issue #1
-----------
- In the SOLUTON ONE: DispatchUtil Solution Code the 'log' variable
declaration is as follows: protected static Log log =
LogFactory.getLog(DispatchUtil.class);
- In the SOLUTION TWO: (new) DispatchAction Solution Code the 'log'


variable


declaration is as follows: protected static Log log =
LogFactory.getLog(SimpleDispatchAction.class);
* My first question is: In the second 'log' variable declaration, Where


does


SimpleDispatchAction.class comes from? Shouldn't it read
DispatchAction.class?

Issue #2
-----------
- I have a class that extends my (new) DispatchAction class. Within this
class I have coded the methods that will perform the actions referenced


by


the <html:submit...> buttons in my forms, i.e.
public ActionForward [ next | back | finish ] (
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{ ... }
- In my JSP forms, every button is defined like this:
<html:form action="/wizard">
 <html:hidden property="page" value="[ 1 | 2 | 3... ]" />

 <bean:message key="someField.label" />
 <html:text property="someField" />

 <html:submit property="back.dispatch">
  <bean:message key="button.back" />
 </html:submit>

 <html:cancel>
  <bean:message key="button.cancel" />
 </html:cancel>

<html:submit property="next.dispatch">
<bean:message key="button.next" />
</html:submit>
</html:form>
* My second question is kinda stupid: What's next? I mean, It seems like


I


can use struts-config.xml to get things working MappingDispatchAction


style


or LookupDispatchAction style, but since the (new) DispatchAction (aka
DispatchUtil) takes care of things transparently, What would be the next
step to implement SOLUTION TWO?

Issue #3
-----------
* I don't get what this means :^( [Section 3.1. Action Class Code to


Use]


"In all the following tag uses, you use the Action class code in
execute(...) or process(...) as given directly below.
ActionForward = forward = new
DispatchUtil().dispatch(this,mapping,form,request,response);"

Again, any help would be greatly appreciated.

Have a nice day!

Regards,

Carlos


----- Original Message ----- From: "Michael McGrady" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, September 23, 2004 9:00 PM
Subject: Re: [HOW TO? ImageButtonBeanManager Extension]







Carlos,

This solution just adds weight (ImageButtonBean) on top of
(DispatchAction) and combines what are the same solutions really.  I
would suggest you look at what might be improvements to this sort of
suggestion at
http://wiki.apache.org/struts/StrutsCatalogFiveMultipleButtonSolutions .

Amazing how oftent this comes up.

Michael McGrady

Carlos Cajina - Hotmail wrote:





Hi. I'm tryin' to add this Strust extension to my project and from the




documentation I understand that what I need to do is create my Action


Flow


using the SubmitButtonForwardDispatchAction, but after coding my Action


Form


and Action classes and setting up struts-config.xml I keep getting this
error:




2004-09-23 19:10:08,062 DEBUG


[org.apache.struts.action.RequestProcessor]




Looking for Action instance for class
com.mitranosoft.struts.actions.SubmitButtonForwardDispatchAction




2004-09-23 19:10:08,062 DEBUG


[org.apache.struts.action.RequestProcessor]




Creating new Action instance




2004-09-23 19:10:08,156 WARN




[com.mitranosoft.struts.actions.SubmitButtonForwardDispatchAction]
SubmitButtonForwardDispatchAction.execute(): Warning - Error encountered


and


handled while attempting to locate ActionForward property-name=[ submit ]


of


[EMAIL PROTECTED], for Request=[


[EMAIL PROTECTED]/webm/asist


e


nte.do,contextPath=/webm,method=POST,queryString=<null>,sessionId=BDCA61971


5


A1B419D6785F9CAADC7185] ].




2004-09-23 19:10:08,156 DEBUG




[com.mitranosoft.struts.util.DefaultActionForwardSelector]
DefaultActionForwardSelector.getActionForward(): Returning a default
ActionForward matching name=[ otherwise ]. ActionForward=[


[EMAIL PROTECTED],path=/index.j


s


p,redirect=false,contextRelative=false] ], ActionForm=[
[EMAIL PROTECTED] ], for Request=[


[EMAIL PROTECTED]/webm/asist


e


nte.do,contextPath=/webm,method=POST,queryString=<null>,sessionId=BDCA61971


5


A1B419D6785F9CAADC7185] ]




2004-09-23 19:10:08,156 WARN




[com.mitranosoft.struts.actions.SubmitButtonForwardDispatchAction]
SubmitButtonForwardDispatchAction.execute(): Warning - A default


ActionForm


has been selected or created, ActionForward=[


[EMAIL PROTECTED],path=/index.j


s


p,redirect=false,contextRelative=false] ], because no property was found


for


property-name=[ submit ] of [EMAIL PROTECTED], for
Request=[


[EMAIL PROTECTED]/webm/asist


e


nte.do,contextPath=/webm,method=POST,queryString=<null>,sessionId=BDCA61971


5


A1B419D6785F9CAADC7185] ]




2004-09-23 19:10:08,156 DEBUG


[org.apache.struts.action.RequestProcessor]




processForwardConfig(ForwardConfig[name=otherwise,path=/index.jsp,redirect=


f


alse])




- In each of JSP's I have this for my buttons except for <html:cancel>:
<html:submit property="submit">

 <bean:message key="button.XXXX" /> // Where XXXX could be 'next',




'back', 'finish'




</html:submit>

I understand that the extension -through the




SubmitButtonForwardDispatchAction action- does the job of automatically
mapping a <html:submit...> button to an Action that is supposed to


process


the specific business logic that button encapsulates, acting like some


kind


of hub for every incoming button click in the JSP forms, but I don't know
whether I am missing something because things just won't work.




It's worth saying that the mapping in the




SubmitButtonForwardDispatchAction for a 'cancel' action works fine,


whenever


I hit the cancel button in my form I'm redirected to the correct


location;


also the 'otherwise' mapping works good... it's were I'm taken to


everytime


I hit the next button and the errors pops up in the log files :^P




For any help, my eternal gratitude :^)

Have a nice evening.

Regards,

Carlos







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]









--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]









--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to