cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <DHo...@csir.co.za>
Subject Re: Passing a '+' in a request parameter?
Date Wed, 27 Feb 2002 06:36:40 GMT
Chris

Basically, I am trying to update (add/change) values in a database,
based
on the model/sample that is presented in the Cocoon installation (the
one
that uses the DatabaseXXXActions) .  It so happens that one of the
fields 
in my database often contains a '+' sign.  The updates work fine,
except that 
when I try and do an update with a record that has a '+' in that
particular field, 
then all the information after the '+' is lost (as is reflected in an
incomplete
entry in the database record).  Now, as I cannot see how the info
is passed from the form to the DatabaseXXXActions, my conclusion was
that it
was done via request parameters and that this was causing the fault.

Someone else suggested that ", if you're building an URL yourself to
pass request values,
you should URLencode these values, using for example the
java.net.URLEncoder class."

Based on what you said below - I am now not completely sure what *is* 
causing the problem, but I can see there is one...

The sitemap snippets look like:

   <map:match pattern="test/chemical.xsp">
     <map:act set="dbentry">
       <map:parameter name="descriptor"
value="context://biotox/test/chemical.xml" />
       <map:generate type="serverpages" src="test/chemical.xsp"/>
       <map:transform src="styles/dynamic-page2html.xsl">
          <map:parameter name="view-source" value="test/chemical.xsp"
/>
       </map:transform>       
       <map:serialize />
     </map:act>
     <!-- if action fails, then... -->
     <map:generate type="serverpages" src="test/chemical.xsp" />
     <map:transform src="styles/dynamic-page2html.xsl">
         <map:parameter name="view-source" value="test/chemical.xsp"
/>
     </map:transform>
     <map:serialize />     
   </map:match> 

where the action set "dbentry" is:

 <map:action-sets>
  <map:action-set name="dbentry">
   <map:act type="add-dbentry" action="Add"/>
   <map:act type="del-dbentry" action="Delete"/>
   <map:act type="upd-dbentry" action="Update"/>
  </map:action-set>
 </map:action-sets>
 
and the action types are:

   <map:action name="add-dbentry"
src="org.apache.cocoon.acting.DatabaseAddAction"/>
   <map:action name="del-dbentry"
src="org.apache.cocoon.acting.DatabaseDeleteAction"/>
   <map:action name="upd-dbentry"
src="org.apache.cocoon.acting.DatabaseUpdateAction"/>


A seemingly simple problem, but one I cannot resolve.

Thanks
Derek


>>> haul@dvs1.informatik.tu-darmstadt.de 26/02/2002 10:40:58 >>>
On 25.Feb.2002 -- 09:33 AM, Derek Hohls wrote:
> I have data that I am reading from a database field (problematic at
the
> best of times);
> I need to pass the field data in a request parameter BUT I have
noticed
> problems when
> one of the fields contains a '+'.  In other words, an attempt
request
> such as:
> 
> ?value1=ab+cd&value2=xyz
> 
> is shown as
> 
> ?value1=ab+cd
> 
> and do loses the the second value because the '+' seems to be acting
as
> a separator of sorts...

Hi,

could you please be a bit more specific on what you are trying to
achieve?
The picture above does not sound complete. The database actions never
set
request parameters. Actually, whithout creating a new request you are
not
able to set request parameters. So there is definitely something
missing
above.

Where and how are the parameters set and where and how do you observe
the
wrong result?

Please post a sitemap snippet that contains all used pipelines.

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de 
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


---------------------------------------------------------------------
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message