What changes do I make in struts-config  to initialization method is 
called like constructor of DispathAction .


from index.jsp I call 
<c:redirect url="diceSetUp.do?dispatch=diceWebSetUp"/>


subsequent jsp has following lines to call another action 
                <c:url var="url" scope="page" value="/sectorProcess.do">
                    <c:param name="sectorId" value="${sector.sectorId}"/>
                    <c:param name="dispatch" value="delete"/>
                </c:url>

My struts config looks like this..

                <action
                path="/diceSetUp"
                name="sectorForm"
                type="com.dice.web.action.SetupAction"
                scope="request"
                parameter="dispatch">
            <forward name="failure" path="/sectorForm.jsp"/>
            <forward name="success" path="/sectors.jsp"/>
        </action>

            <action
                path="/sectorProcess"
                name="sectorForm"
                type="com.jpmc.ib.usgcpt.dice.web.action.SectorAction"
                scope="request"
                parameter="dispatch">
            <forward name="failure" path="/sectorForm.jsp"/>
            <forward name="success" path="/sectors.jsp"/>
        </action>




kalpesh modi <[EMAIL PROTECTED]>
02/07/2006 03:15 PM
Please respond to "Struts Users Mailing List"

 
        To:     Struts Users Mailing List <user@struts.apache.org>
        cc: 
        Subject:        Re: DispatchAction question !


 Put your initialization code in method


public ActionForward initialize(ActionMapping mapping, 
ActionForm 
form, HttpServletRequest request, HttpServletResponse response) 
throws 
Exception {

sectService = new SectorDaoService(request);
sectOwnerService = new SectorOwnerDaoService();
sectService.getSectors();
return mapping.findForward(--the method you want to call--);
}

HTH.


 
---------------------------------
Relax. Yahoo! Mail virus scanning helps detect nasty viruses!


This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein 
do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries 
and affiliates

Reply via email to