If I understand your question, you want to check request parameters and
then only do a query if all the request parameters are correct.  I've done
this by writing tags like this:

<xsl:template match="mylib:if-valid-query">
  <xsp:logic>
    if (...) {
      <xsl:apply-templates/>
    }
  </xsp:logic>
</xsl:template>

Then you write your XSP like so:

<mylib:check-parameters/>
<mylib:if-valid-query>
  <esql:connection>
   ...
  </esql:connection>
</mylib:if-valid-query>

-Christopher




Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:

Subject:  Checking request parameters ....... planing architecture.



I do not want to have java code in my xsp pages,
therefore I want to write a taglibrary for checking
request parameters.

Examples of provided tags:

<date-format param="..." message="...wrong date format..."/>
<check-null param="..." message="...."/>
<check-maxlength param="..." message="...typed text too long..."/>
<check-int param="..." message="...wrong number format..."/>
<check-empty param="..." message="..."/>

the code for each tag will take the request parameter, check a condition
and if it is wrong inserts a <error message="..."/> tag to the document,
which will be displayed for the user.

But, after checking parameters, I want to use <esql:connection> - to
perform
database operations. And I do not know how to make the execution of esql
stuff dependent of tags for parameter checking?


     <check-empty param="X" message="Fill X field"/>
     <check-empty param="Y" message="Fill X field"/>
     <date-format param="Z" message="Type correct date in Z field"/>

     <esql:connection>
          <esql:pool>HelpDesk</esql:pool>
          <esql:execute-query>
          <query>INSERT INTO DATA (X,Y,Z) VALUES (
               <esql:parameter><request:get-parameter name
="X"/></esql:parameter>
               <esql:parameter><request:get-parameter name
="Y"/></esql:parameter>
               <esql:parameter><request:get-parameter name
="Z"/></esql:parameter>
          </query>
          </esql:execute-query>
     </esql:connection>



--

Kamera wideo Sony, 5000 zl
wygraj w konkursie eMarketu i Onet.pl [ http://konkursy.onet.pl/emarket ]





---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to