cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naquin, Beth" <>
Subject RE: XSP help
Date Wed, 19 Jun 2002 22:34:53 GMT
The file I was talking about was /docs/samples/xsp/logicsheet.xsp in the
cocoon examples.

Basically, it does one thing (ie show a form with input text box) if the
'name' parameter is null.  It does something else (ie print the name that
was entered) if the name parameter is not null.

In the form validation examples, there's a bit of code that will allow you
to know if the user has had a chance to fill in any data yet, or if it's the
first time the use is looking at the page.

It goes something like this ...
<form ...>

 use this to get a clue if the user had a chance to fill in
            any data already 

  <input type="hidden" name="visited" value="true" /> 


  boolean userHasSeenForm = ( 
  <xsp-request:get-parameter name="visited" /> 

	user has already entered data and pressed submit, so do something


You can gather the input from the textbox using <xsp-request> (check out
docs on the request logicsheet)

ex: String x = <xsp-request:get-parameter

Maybe you could do something like this: if(userHasSeenForm){do your query
stuff & print results}

I am new to cocoon myself, so I'm not sure this is the best way to do things
(embedding all your logic right into the xsp page), but seems like it should

-----Original Message-----
From: []
Sent: Wednesday, June 19, 2002 2:27 PM
Subject: RE: XSP help

Thanks for the info.  Both you and Vadim were very helpful....I have
definately read much more about XSP and recognize the mistake in my last
approach.  I was, however, unable to find the the example that you state
that is a form with a text input and a submit button.  That's exactly what
I was looking for!  So far, this is what I have:
<xsp:page language="java" xmlns:xsp=""

   <title>Generation of Metadata.xml</title>
   <form action="" method="POST" name="Metadata">
     <h1>Enter input</h1>
     <textarea name="KO" rows=6 cols=80></textarea>
     <input type=submit value="Generate Metadata">
     <input type=reset value="Reset Form">
     <execute-query xmlns="">
     select * from H2KOBJ.MCK_MDR_PPTY_PD_RLSHP_V  where KO_ID = 400400 and

     <execute-query xmlns="">
     select * from H2KOBJ.MCK_MDR_PPTY_PD_RLSHP_V where KO_ID = 400400 and

Ideally, I would like to do what the sample that you stated does and show
the results of the queries on the same page.  The input from the textarea
will be parsed and I would like to substitute each token into the KO_ID
field in each query...something like <xsp:expr>queryresult</xsp:expr> for
each token.  Could anyone guide me a little further.  I still can't take
that step and figure out how to gather the input from the textbox, only
perform the queries after having done so, and also how to display the
results on the same page.  The last part really isn't that critical as I
could just put it in another file.

Any help would be greatly appreciated.


This message may contain confidential and/or privileged
information.  If you are not the addressee or authorized to
receive this for the addressee, you must not use, copy,
disclose or take any action based on this message or any
information herein.  If you have received this message in
error, please advise the sender immediately by reply e-mail
and delete this message.  Thank you for your cooperation.

Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message