Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 19th, 2006, 05:29 AM
Registered User
 
Join Date: Jul 2006
Location: , , .
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........

Reply With Quote
  #2 (permalink)  
Old July 19th, 2006, 05:56 PM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
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/
Reply With Quote
  #3 (permalink)  
Old July 20th, 2006, 11:46 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
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

Reply With Quote
  #4 (permalink)  
Old July 21st, 2006, 03:02 PM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
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/
Reply With Quote
  #5 (permalink)  
Old August 5th, 2006, 04:51 AM
Authorized User
 
Join Date: Aug 2006
Location: , , .
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:- sachin.tathod@patni.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:12 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.