Search code examples
freemarkerofbiz

Send param in URL using OFBiz


I want to end a param in URL in OFBiz, but I get this error from security

org.apache.ofbiz.webapp.event.EventHandlerException: Found URL parameter [twCompagneDeRecrutementId] 
passed to secure (https) request-map with uri [showCompagne] with an event that calls service [showCompagne]; 
this is not allowed for security reasons! The data should be encrypted by making it part of the request body (a form field) instead of the request URL. 
Moreover it would be kind if you could create a Jira sub-task of https://issues.apache.org/jira/browse/OFBIZ-2330 (check before if a sub-task for this error does not exist). If you are not sure how to create a Jira issue please have a look before at http://cwiki.apache.org/confluence/x/JIB2

This is my ftl

<#if listCompagne??>

            <#list listCompagne as newCompagne>

            <div style="display:flex; width:100%;">
                         <div style="padding:6px; width:24%;"><label>${newCompagne.nom}</label></div> 
                         <div style="padding:6px; width:24%;"><label>${newCompagne.dateDebut ?date}</label></div> 
                         <div style="padding:6px; width:24%;"><label>${newCompagne.dateFin ?date}</label></div>
                         <input type="hidden" value="${newCompagne.twCompagneDeRecrutementId}"/> 
     <div style="padding:6px; width:20%;"> <a class="btn btn-outline-danger btn-block " href="<@ofbizUrl>showCompagne?twCompagneDeRecrutementId=${newCompagne.twCompagneDeRecrutementId}</@ofbizUrl>">afficher</a>
</div>  



           </div>  
           </#list>

Solution

  • the solution is to go to url.properties and change parameters.url.encrypt to no