Spring Filing 4 Shapes

I recently upgraded my Spring framework from 3.1.2 to 4.1.1. Also updated to Tomcat 8 and Java 8. I am also using Tiles 2.2.2.

My web page is loading using Spring 4 and the problem occurs when I do a form submission. The url request changes and leaves the name webapp.

For example, when I do a form submission, the url is assumed to be http: //xx.xx.xx.xx/webappname/createuser/submit .

But the url changes to http: //xx.xx.xx.xx/createuser/submit . And thus, it gives the error "The requested resource is not available".

I didn't have this problem when I was using Spring 3.1.2, Tomcat 7, Java 7.

May I know what is missing?

Thanks, Mustache

EDIT:

My jsp view looks like

<form:form method="post" action = "/createuser/submit" commandName = "createForm" >
 ..... 
< /form>  

      

+3


source to share


2 answers


Prepare your hyperlinks with

${pageContext.request.contextPath}



See the accepted answer here

0


source


Your action url starts by changing the root url of your action to

action = "createuser/submit"   

      

Or use a tag <c:url ... />

to create a url and give it an action like below



<c:url value="createuser/submit" var="myActionUrl" />
<form:form action="${myActionUrl}" .... >   

      

May this help you.

0


source







All Articles