facebook

Duplicate Action Paths in Struts Config

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #249532 Reply

    imaband
    Member

    Hi,

    One of the reasons I purchased a MyEclipse subscription was so I could view the struts-config graphically.

    But the memory hog won’t render the schematic because of duplicate action paths in my struts-config.xml file. The struts app doesn’t seem to care about duplicates but the graphics view does!

    I’m a Struts and MyEclipse newbie so I was wondering if anybody knows whether dup actions like the following are actually BOTH considered and processed by struts and how they are handled (merging, ignoring the first action encountered, ignoring the last action encountered? Thanks!

    <action path=”/plan/objective/RevertCompleteTask”
    type=”com.noink.sfa.admin.struts.plan.ObjectiveTaskRevertAction”
    name=”objForm”
    scope=”session”
    parameter=”permission=plan_application_access”>
    <forward redirect=”true” name=”success” path=”/plan/objective/UpdateTask.do?task.statusId=complete” />
    <forward redirect=”true” name=”error” path=”/plan/objective/Detail.do” />
    </action>

    <action path=”/plan/objective/RevertCompleteTask”
    type=”com.noink.sfa.admin.struts.plan.ObjectiveTaskRevertAction”
    name=”objForm”
    scope=”session”
    parameter=”permission=plan_application_access”>
    <forward name=”success” path=”/plan/objective/Detail.do?task.statusId=incomplete” />
    <forward redirect=”true” name=”error” path=”/plan/Objectives.do” />
    </action>

    #249535 Reply

    Riyad Kalla
    Member

    It’s true, our tools don’t support invalid configurations well. Having duplicates will typically process the first one. I’m not sure why you have duplicates or how you are able to even make use of the second one.

    Have you tried commenting it out then opening it with the designer?

    #249545 Reply

    imaband
    Member

    Riyad,
    I found the following quote on the web via Google at

    http://mail-archives.apache.org/mod_mbox/struts-user/200407.mbox/%3C019c01c45f4e$fac1a8e0$34000a0a@auburn%3E

    “if you define duplicate action-mapping (by
    path) or form-beans (by name), the last one loaded silently wins.”

    This conflicts with your “Having duplicates will typically process the first one” but I can reslove that behavior via experimentation. I inherited this code so I’m as perplexed as to why there are duplicates as you.

    The struts-config file is over 2500 lines long so my 768MB of RAM is extremely taxed. I’ll look into getting more RAM but does MyEclipse support some way of breaking the struts-config.xml into separate, more managable files each with a different .mex file?

    Also, does MyEclipse also render the tiles-defs.xml file so you can view the tiled JSPs graphically?

    thanks

    Jeff

    #249548 Reply

    imaband
    Member

    I added another 256M of RAM to my PC maxing it out at 1.12Gig and each keypress while in the stupid struts-config.xml file takes FOREVER! We’re talking anywhere from 30 seconds to over a minute while the rest of the system is brought to it’s knees. I figured 1Gig was enough for MyEclipse but is it really that much of a hog?

    #249553 Reply

    Riyad Kalla
    Member

    Jeff,
    Looks like I was wrong about the action processing.

    Your experience with the editor sounds just horrible, can you use the command line arguments and instructions from this tip: http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-10087.html

    and see if they improve? If not, can you send me the struts-config.xml file to beat on?

    #249555 Reply

    imaband
    Member

    Riyad,

    I guess those extra command line parameters really make a difference (-XX:PermSize=64M -XX:MaxPermSize=128M)

    Now that I have the gigantic action map I realize it is not much easier to work with than the XML! At least from a maintenance perspective.

    Thanks for your help!

    Jeff

    #249559 Reply

    Riyad Kalla
    Member

    Sorry to hear it didn’t help much, but I”m glad it’s working.

    And yes, permSize in eclipse in general will help a lot with performance, especially bigged products like MyEclipse.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Duplicate Action Paths in Struts Config

You must be logged in to post in the forum log in