Results 1 to 3 of 3

Thread: Issues setting relative paths in action attribute

  1. #1
    Join Date
    Dec 2012
    Posts
    3

    Default Issues setting relative paths in action attribute

    Hi,

    I'm new to Spring and I'm having issues setting relative paths for the action attributes in my JSP files.

    This is how my JSP file looks like

    <form:form name="recordListForm" id="recordListForm" method="post" commandName="documents" action="/warfilename/enrolment/listEmployees">

    warfilename is the name of the war file that is generated and deployed on server.

    and this how my Controller looks like

    @RequestMapping(value = "/enrolment/listEmployees", method = RequestMethod.POST)

    But the name of the war file can be changed once I deliver it to the client and if they change it, it would not work. How can I fix this issue by setting the relative path.

    Thanks,

  2. #2
    Join Date
    Dec 2012
    Posts
    3

    Default

    I was able to fix it by modifying action like below in my jsp file.

    Thanks

    action="docDetails"

    Quote Originally Posted by java_1234 View Post
    Hi,

    I'm new to Spring and I'm having issues setting relative paths for the action attributes in my JSP files.

    This is how my JSP file looks like

    <form:form name="recordListForm" id="recordListForm" method="post" commandName="documents" action="/warfilename/enrolment/listEmployees">

    warfilename is the name of the war file that is generated and deployed on server.

    and this how my Controller looks like

    @RequestMapping(value = "/enrolment/listEmployees", method = RequestMethod.POST)

    But the name of the war file can be changed once I deliver it to the client and if they change it, it would not work. How can I fix this issue by setting the relative path.

    Thanks,

  3. #3
    Join Date
    Jun 2012
    Location
    Noida
    Posts
    2

    Default

    only use "/enrolment/listEmployees" in your jsp it will work

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •