Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 19th, 2006, 05:29 AM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to warsha_14
Default based upon parameter perform action

I am building an application that on loading first show one drop down ... based on selection from drop down , it display result at same jsp page. After that same jsp has various functionality... like create rule, update rule, delete rule. After performing respective action same JSP displays after refreshing...... how did I pass different parameter for performing different action........

 
Old July 19th, 2006, 05:56 PM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you're overthinking things. Why can't you just link to the actions you defined in struts-config.xml? E.g. <a href="createRule.do">Create Rule</a>. I don't see how your requirements specify something more complicated than that. Please clarify if I'm misunderstanding you.

Jon Emerson
http://blogs.adobe.com/jon.emerson/
 
Old July 20th, 2006, 11:46 PM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to warsha_14
Default

My requirement is that on same page, I have many action like after creation of "rule", same page will be refreshed with the list of latest created rule , It has button to delete or duplicate or change its priority... After all these action without redirecting to other page , same page will refresh

 
Old July 21st, 2006, 03:02 PM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, so have your buttons point to deleteRule.do, duplicateRule.do, changePriotiy.do, etc. In struts-config.xml, set these actions to forward to the [u]list rules</u> view when they're finished.

Jon Emerson
http://www.jonemerson.net/
 
Old August 5th, 2006, 04:51 AM
Authorized User
 
Join Date: Aug 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to sachin.tathod
Default

Please use as follows:

Define string and set it for default value.

String forwardPage = "listtypes";

and then depending upon the rule set value for forwardPage .

and then use

return mapping.findForward(forwardPage);

Plz take help of following code:-


  public ActionForward list(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws Exception {
        logger.entering();

        String forwardPage = "listtypes";
        GroupTypeForm groupTypeForm = (GroupTypeForm) form;
        List paymentPlanList = null;
        ResdeskSessionManager session = ResdeskPageAction.getResdeskSessionManager(request );
        PKComponentRequestVO requestVO = session.getPKComponentRequestVO();
        PKResdeskXDelegate pkResdeskXDelegate = new PKResdeskXDelegate();

        try {
            if (ResdeskPageAction.checkAndTouchLogin(request, response,
                        PasskeyUtils.getResDeskAppID().intValue())) {
                return null; // session has expired
            }

            if (((null != request.getParameter("subaction")) &&
                    "editPayPlan".equals(request.getParameter("subacti on"))) ||
                    ((null != request.getParameter("subaction")) &&
                    "showPlanDetails".equals(request.getParameter("sub action")))) {
                forwardPage = "editPayPlan";
                request.setAttribute("planID", request.getParameter("planID"));
                request.setAttribute("groupTypeId",
                    request.getParameter("groupTypeId"));
                request.setAttribute("guaranteeRequired", request.getParameter("guarantee"));
                request.setAttribute("name", request.getParameter("name"));
                requestVO.setComponentTypeId(PKComponentRequestVO. GUARANTEE);
                paymentPlanList = pkResdeskXDelegate.listByEvent(requestVO);
                request.setAttribute("PaymentPlanList", paymentPlanList);
            }
            requestVO.setComponentTypeId(PKComponentRequestVO. GROUP_TYPE);

            List attendeeTypeUICVOList = pkResdeskXDelegate.listAttendeeTypesByEvent(reques tVO);
             requestVO.setComponentId(groupTypeForm.getGroupTyp eId());
             request.setAttribute("ATTENDEETYPEUICVOLIST", attendeeTypeUICVOList);
            AccessPrivilegeVO accessPriviligeVO = pkResdeskXDelegate.getAccessPrivileges(requestVO);
            session.putSessionData(ConstantDeclareI.ACCESSPREV ILEGE,
                accessPriviligeVO);
        } catch (Exception exp) {
            return ExceptionService.handleException(logger, exp, request,
                mapping);
        }

        // For Summary menu
        request.setAttribute("DISP_PAGE", "AttendeeTypes");

        ResdeskXAction.setBreadCrumbs(session,
            TemplateConstants.EVENT_ATTENDEETYPES_PAGEID);
        logger.exiting();

        return mapping.findForward(forwardPage);
    }


Thanx

Sachin

Thanks and Regards,
SACHIN S.TATHOD
Patni Computer System Ltd.
Magarpatta City, Cyber City,
Tower 3,Level I & II,
Hadapsar,Pune - 411028
Mobile No:- +91-9881239401
Email ID:- [email protected]





Similar Threads
Thread Thread Starter Forum Replies Last Post
Request action on change and get no action. Help crussell Ajax 0 September 12th, 2007 11:11 AM
Action Script based Charts (bar, pie, etc). robprell Flash (all versions) 0 March 30th, 2007 08:17 PM
Refreshing a page based on action in pop-up nkrust ASP.NET 1.0 and 1.1 Basics 4 January 15th, 2007 04:21 PM
Connection cannot be used to perform this operatio LibrarianMo Access ASP 1 February 24th, 2006 01:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.