java - Troubles submitting a jsp form -


i have trouble jsp form , can't make work. explain me why works :

<%@ page session="false"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ page iselignored="false"%> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> <form:form modelattribute="categoriesitem" method="post"         action="facebook/categorize">         <fieldset>             <form:select path="categories['${liste}']">                 <option value="none" selected>none</option>                 <option value="family">family</option>                 <option value="professionnal">professionnal</option>                 <option value="friend">friend</option>             </form:select>             <input type="submit" />         </fieldset>     </form:form> 

and doesn't ?

<%@ page session="false"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ page iselignored="false"%> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> <form:form modelattribute="categoriesitem" method="post"     action="<c:url value="/facebook/categorize" />">     <fieldset>         <form:select path="categories['${liste}']">             <option value="none" selected>none</option>             <option value="family">family</option>             <option value="professionnal">professionnal</option>             <option value="friend">friend</option>         </form:select>         <input type="submit" />     </fieldset> </form:form> 

as can see, difference in action tag , yet, doesn't work , error :

org.apache.jasper.jasperexception: /web-inf/views/prehandlefacebook.jsp (line: 30, column: 24) tag &lt;form:form non terminé     org.apache.jasper.compiler.defaulterrorhandler.jsperror(defaulterrorhandler.java:42)     org.apache.jasper.compiler.errordispatcher.dispatch(errordispatcher.java:443)     org.apache.jasper.compiler.errordispatcher.jsperror(errordispatcher.java:133)     org.apache.jasper.compiler.parser.parseoptionalbody(parser.java:992)     org.apache.jasper.compiler.parser.parsecustomtag(parser.java:1274)     org.apache.jasper.compiler.parser.parseelements(parser.java:1452)     org.apache.jasper.compiler.parser.parse(parser.java:138)     org.apache.jasper.compiler.parsercontroller.doparse(parsercontroller.java:242)     org.apache.jasper.compiler.parsercontroller.parse(parsercontroller.java:102)     org.apache.jasper.compiler.compiler.generatejava(compiler.java:198)     org.apache.jasper.compiler.compiler.compile(compiler.java:373)     org.apache.jasper.compiler.compiler.compile(compiler.java:353)     org.apache.jasper.compiler.compiler.compile(compiler.java:340)     org.apache.jasper.jspcompilationcontext.compile(jspcompilationcontext.java:646)     org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:357)     org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:390)     org.apache.jasper.servlet.jspservlet.service(jspservlet.java:334)     javax.servlet.http.httpservlet.service(httpservlet.java:728)     org.springframework.web.servlet.view.internalresourceview.rendermergedoutputmodel(internalresourceview.java:238)     org.springframework.web.servlet.view.abstractview.render(abstractview.java:263)     org.springframework.web.servlet.dispatcherservlet.render(dispatcherservlet.java:1208)     org.springframework.web.servlet.dispatcherservlet.processdispatchresult(dispatcherservlet.java:992)     org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:939)     org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:856)     org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:936)     org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:827)     javax.servlet.http.httpservlet.service(httpservlet.java:621)     org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:812)     javax.servlet.http.httpservlet.service(httpservlet.java:728)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:311)     org.springframework.security.web.access.intercept.filtersecurityinterceptor.invoke(filtersecurityinterceptor.java:116)     org.springframework.security.web.access.intercept.filtersecurityinterceptor.dofilter(filtersecurityinterceptor.java:83)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323)     org.springframework.security.web.access.exceptiontranslationfilter.dofilter(exceptiontranslationfilter.java:113)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323)     org.springframework.security.web.session.sessionmanagementfilter.dofilter(sessionmanagementfilter.java:101)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323)     org.springframework.security.web.authentication.anonymousauthenticationfilter.dofilter(anonymousauthenticationfilter.java:113)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323)     org.springframework.security.web.servletapi.securitycontextholderawarerequestfilter.dofilter(securitycontextholderawarerequestfilter.java:54)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323)     org.springframework.security.web.savedrequest.requestcacheawarefilter.dofilter(requestcacheawarefilter.java:45)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323)     org.springframework.security.web.authentication.www.basicauthenticationfilter.dofilter(basicauthenticationfilter.java:150)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323)     org.springframework.security.web.authentication.abstractauthenticationprocessingfilter.dofilter(abstractauthenticationprocessingfilter.java:182)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323)     org.springframework.security.web.authentication.logout.logoutfilter.dofilter(logoutfilter.java:105)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323)     org.springframework.security.web.context.securitycontextpersistencefilter.dofilter(securitycontextpersistencefilter.java:87)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323)     org.springframework.security.web.filterchainproxy.dofilter(filterchainproxy.java:173)     org.springframework.web.filter.delegatingfilterproxy.invokedelegate(delegatingfilterproxy.java:346)     org.springframework.web.filter.delegatingfilterproxy.dofilter(delegatingfilterproxy.java:259)     org.springframework.web.filter.hiddenhttpmethodfilter.dofilterinternal(hiddenhttpmethodfilter.java:77)     org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107)     org.springframework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:88)     org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) 

could incompatibility between 2 el languages ?

this

action="facebook/categorize"> 

tells browser relativize facebook/categorize url on. if on www.myapp.com/myapp/facebook, when submit, browser post request www.myapp.com/myapp/facebook/facebook/categorize (which assume wrong). note if path instead /facebook/categorize (extra / @ start), appended host, not context.

this

action="<c:url value="/facebook/categorize" />"> 

gets rendered full path (relative context root). if host + context myapp.com/myapp, rendered myapp.com/myapp/facebook/categorize.


Comments