Q.What is DispatchAction?
DispatchAction is specialized child of Struts Action class. It combines or group the methods that can further access the bussiness logic at a single place. The method can be anyone from CRUD [Create,Retrieve,Update or Delete] or it can be security check one like authenticate user etc.This class apart from having thread-safe execute method also can have user-defined methods.
In struts-config.xml files following changes are required for Dispatch action to work:
If above is your struts-config.xml file structure and LoginAction extends DispatchAction instead of normal Action class. And assuming [keep assuming] your LoginAction class have method named authenticateUser, then in your login.jsp add any hidden parameter called task with value as your method name and on submit of that page following will be the url:http://localhost:8080/yourproject/jsp/login.jsp?login.do&task=authenticateUserThus if we try to combine the last part of this puzzle we get the climax at struts-config.xml file's action-mapping tag described above.
The parameter property of
Q.How to call ejb from Struts?
We can call EJB from struts by using the service locator design patteren or by Using initial context with create home object and getting return remote referenc object.
Q.In struts how can i validate the values filled into the text boxes or else using DynaValidatorForm,without using javascript.Actually with javascript it is working perfect but not without javascript, and i want without javascript?
Using the validate() method of the ActionForm class, the values filled in the form will be validated in the case there is no JavaScript for validating the form.
1 comments:
Great Blog Thanks.
Here You Can Find Your First Round Interview question For Job .
Struts Interview Questions
OOPs Interview Questions
JSP Interview Questions
Post a Comment