It first goes to the index.jsp. Here it displays the link to the "lookupDispatchAction.jsp". On clicking the link it goes to lookupDispatchAction.jsp. In lookupDispatchaction.jsp it displays the text in the buttons by consulting the ApplicationResources.properties files. When one clicks on the particular button then its saves the value in the parameter property. It then goes to the lookupDispatchAction and executes the LookupDispatchExample class. There you have various methods for different button clicks. As per the click of the particular button that method is called. It then return the particular string e.g. add and it checks for that particular string in action mapping and displays the appopriate jsp.
1) Is my understanding of the lookupdispatchaction flow correct ? If not then please do give the correct flow of lookupdispatchaction and clarify my understanding.
2) Where does the "getKeyMethodMap()" come into the picture ? I didn't get the purpose of Map here.
3) Is lookupdispatchaction only used for internationalization ? Other than that isn't it simmilar to dispatchaction ?
The site helped but not that much. It dosn't give the flow of lookupdispatchaction. I still didn't get what is the purpose of getKyMethodMap() where is the Map being used. resource bundle is used to label the buttons. But how is the resource bundle used in the Map.
I don't want to gulp it down. I want to clarify my concept so that I don't forget ever.
Siddharth Bhargava wrote:I still didn't get what is the purpose of getKyMethodMap() where is the Map being used. resource bundle is used to label the buttons. But how is the resource bundle used in the Map.
Well the resource bundle is not used in the Map. You have to implement getKeyMethodMap() so that a link is created between the resource bundle, the button in jsp and the method name in action class.
Here is a example
Now in this imlementation, the key names should be the same as mentioned in the resource bunlde and their corresponding values should be the method name in action class.
Now in the jsp you will have something like this
The generated html for this would be if you have set the corresponding entry to 'Save' in resource bundle.
When you hit the Save button, parameter along with the action would be "action=Save". The action class (LookUpDispatchAction implementation ) will take this value of 'Save', find the correspoding 'message resource key' for this value in this case 'button.save'. Now with the help of getKeyMethodMap the value for this key is save() method, which will be invoked and request will be processed.
Hope this helps.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com