Dec 7th, 2012, 09:09 AM
Issues setting relative paths in action attribute
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.
Dec 7th, 2012, 12:06 PM
I was able to fix it by modifying action like below in my jsp file.
Originally Posted by java_1234
Dec 8th, 2012, 04:12 PM
only use "/enrolment/listEmployees" in your jsp it will work