Announcement Announcement Module
Collapse
No announcement yet.
Issues setting relative paths in action attribute Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    I was able to fix it by modifying action like below in my jsp file.

    Thanks

    action="docDetails"

    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,

    Comment


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

      Comment

      Working...
      X