1 Reply Latest reply on Oct 30, 2009 11:44 AM by Nikolay Elenkov

    action execute in pages.xml

    guus vorsterman Newbie

      In my page.xml


      this code works, I get the id param in my method:


       <action execute="#{dbUtils.deleteULD(param.id)}"/>





      but I want it like this, but it does not work:


      <action execute="#{dbUtils.executeUpdate('update uld set uld_f_intake=false where id='+param.id)}"/>




      Is it possible to do this?





        • 1. Re: action execute in pages.xml
          Nikolay Elenkov Master

          guus vorsterman wrote on Oct 30, 2009 10:35:



          <action execute="#{dbUtils.executeUpdate('update uld set uld_f_intake=false where id='+param.id)}"/>




          Is it possible to do this?



          Probably yes, but it is a very bad idea. Reasons:



          1. that's SQL injection waiting to happen.

          2. pages.xml is not where you want your SQL code to live

          3. deleting something as a side effect of navigation is not a good idea either



          Better rethink your design first. What are trying to achieve?