cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vadim.gritse...@verizon.net>
Subject RE: XSP help
Date Wed, 19 Jun 2002 18:35:17 GMT
> From: Gerardo_Flores@mckinsey.com [mailto:Gerardo_Flores@mckinsey.com]
> 
> Hello all, first post to this listserv :)  I'm having a little trouble
> learning how to write XSPs. 

Please start learning XSP writing with reading samples which are
provided with the Cocoon. 

There are several things which you got wrong in your XSP. Once you
compare your XSP with the samples, it will be obvious to you what is
wrong.

For database queries, take a look at ESQL logicsheet XSP sample and
SQLTransformer sample.

Vadim


> I want to perform a very simple task, yet
> really can't find many examples of XSPs anywhere on the web that will
help
> me accomplish my task.  What I would like to do is write an XSP that
will
> display a text area and a submit button and will then perform a
database
> query with the contents of the string retrieved from the text area.  I
> really have no real idea of how to start.  I was basing myself on the
file
> upload example in Cocoon but getting nowhere.  I'm using Tomcat 3.2
and
> Cocoon 2.0.  So far what I have is something like this that I hope
makes
> some sense:
> 
> <?xml version="1.0"?>
> <?cocoon-process type="xsp"?>
> <xsp:page
>   language="java"
>   xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>   xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>   xmlns:xsp-response="http://apache.org/xsp/response/2.0"
>   xmlns:log="http://apache.org/xsp/log/2.0">
> 
>  <page>
>     <title>Search for a Knowledge Object</title>
>     <content>
>       <para>
>         <form method="post" enctype="multipart/form-data"
action="upload">
>          <textarea name="KONames" rows=6 cols=80></textarea>
>       <p><input type="submit" value="Generate Metadata" /></p>
>         </form>
>       </para>
>       <para>
>       <ul>
>         <xsp:logic>
> 
> 
>         </xsp:logic>
>       </ul>
>       </para>
> 
>     </content>
>   </page>
> 
> </xsp:page>
> 
> Then in the XSP:logic tags, I would perform the necessary queries.
Don't
> know if this is the way to go about it.  Also, I know that I must
change
> the action attribute in <form> to something else, but what?  What I
don't
> understand is how to make my code run after the submit button has been
> pressed.  I am assuming that this XSP page will generate xml and then
I can
> apply a stylesheet to format the data as I see fit.  Am I totally
going
> about this the wrong way?  Could anyone suggest a better approach.  It
> seems as though XSP resources on the web are limited, could someone
also
> point me to some good XSP sites?
> 
> Thanks in advance,
> 
> -gerardo


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

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message