facebook

WEb project Change to Context root broken struts paths

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #270805 Reply

    invantix
    Member

    Hi,

    I changed the context root for my project from “/” to “/adminportal” using project properties. After doing so the paths in my struts actions did not change so I receive errors.

    For example /login.do did not change to /adminportal/login.do so I get an error
    The requested resource (/login.do) is not available.

    I assume I need to update a config file so that struts knows to prepend /adminportal to the paths.

    Thanks

    #270809 Reply

    invantix
    Member

    For example /login.do did not change to /adminportal/login.do so I get an error
    The requested resource (/login.do) is not available.

    Actually I should say that forms in my JSP specify “/login.do”. Is there something in the config that would prepend the context root for all form posts?

    Thanks

    #270942 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    invantix,
    Unfortunately no, you would need to do a find-replace of every path (/*) and likely change it to the desired prefix, in this case /adminportal/*

    I wish there were an easier way but there isn’t.

    #271101 Reply

    invantix
    Member

    @support-rkalla wrote:

    Moving to OT > Soft Dev

    invantix,
    Unfortunately no, you would need to do a find-replace of every path (/*) and likely change it to the desired prefix, in this case /adminportal/*

    I wish there were an easier way but there isn’t.

    This seems like a fundamental flaw with the struts architecture. Does the same problem exist with Spring? I had been considering Spring for new projects for other reasons. This would be another reason.

    Thanks,

    Chris

    #271110 Reply

    Riyad Kalla
    Member

    Chris,
    I haven’t done anything with Spring MVC or Web Flow, so I’m not 100% positive, but yes, I believe the mappings *are* done from XML files just like Struts. Same with JSF.

    The one framework that won’t suffer from this is Wicket, since you forward to classes that represent pages. It seems to be (from what I’ve seen and odne with it) refactor-proof.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: WEb project Change to Context root broken struts paths

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