You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Antonio Gallardo Rivera <ag...@agsoftware.dnsalias.com> on 2002/08/18 09:09:47 UTC

How to send a parameter of type "long" to a FormValidator

I am trying the tutorial example that comes with Cocoon.

When I try to create a employe or update a department. I always get this error 
in the sitemap.log file:

Thread-14/AbstractValidatorAction: Validating long parameter department 
(encoded in a string: true)

Then, my question is: How I can send a parameter of type "long" in a request 
string? Is there another method todo that?

I am using: Cocoon 2.0.3
		Tomcat 4.1.9
		Sun Java 1.4.

Please help me.

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


SUMMARY How to send a parameter of type "long" to a FormValidator

Posted by Antonio Gallardo Rivera <ag...@agsoftware.dnsalias.com>.
I finally resolve the problem I got about the tutorial sample.

CAUSE:
I reformated the code of the source file result-dept.xsp. of the tutorial from 
the original to:

<parameter name="id">
	<xsp:attribute name="value">
		<esql:get-string column="department_id"/>
	</xsp:attribute>
</parameter>

This means that the parameter included one or more characters "\n". That is 
VERY BAD in the case we are validating a numeric format like "int" or "long" 
or another numeric format.

SOLUTION: Just put all this thing together in the same line:

<parameter name="id"><xsp:attribute name="value"><esql:get-string 
column="department_id"/></xsp:attribute></parameter>

With this approach no more "\n" will be in the parameter we are sending 
("id"). This means that the FormValidator will not fault anymore.

CONCLUSION:
I know this is a very simple thing, but I dont found about this nowhere. Maybe 
is but I am new. Sorry, fot taking your time about this problem. :)

THANKS:
I want to thanks to Christian Haul, he gives me the clue about how to resolve 
my problem. He told me I need to see in the logfile:

WEB-INF\logs\core.log

to see how Cocoon works.

WHAT IS NEXT?
I will start to playing about Session and permissions.

Regards,

Antonio Gallardo


El Domingo, 18 de Agosto de 2002 01:09, Antonio Gallardo Rivera escribió:
> I am trying the tutorial example that comes with Cocoon.
>
> When I try to create a employe or update a department. I always get this
> error in the sitemap.log file:
>
> Thread-14/AbstractValidatorAction: Validating long parameter department
> (encoded in a string: true)
>
> Then, my question is: How I can send a parameter of type "long" in a
> request string? Is there another method todo that?
>
> I am using: Cocoon 2.0.3
> 		Tomcat 4.1.9
> 		Sun Java 1.4.
>
> Please help me.
>
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>

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


Re: How to send a parameter of type "long" to a FormValidator

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 18.Aug.2002 -- 04:06 AM, Antonio Gallardo Rivera wrote:
> Sorry, but I am not validatong a session id.

Yes, that's what I understood. You're validating a form parameter.

> The parameter is the key of the table department. His name is: id
> Then after the message:

?? this should be unrelated ??

> 	Thread-14/AbstractValidatorAction: Validating parameter: id
> 	Thread-14/AbstractValidatorAction: Validating long parameter id (encoded in a 
> string: true)
> 	Thread-14/FormValidatorAction: Validation failed for parameter id

>From looking at the code, it appears that id cannot be parsed as long.
Maybe it is null? Please look at the parameters as reported in core.log
and post the validation rules.

	Chris.

Please follow up summarizing your problem and which suggested solution
/ information worked for you when you consider your problem
solved. Add "SUMMARY: " to the subject line. This will make FAQ
generation and searching the list easier. In addition, it makes
helping you more fun. Thank you.

-- 
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/faq/index.html>

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


Re: How to send a parameter of type "long" to a FormValidator

Posted by Antonio Gallardo Rivera <ag...@agsoftware.dnsalias.com>.
Sorry, but I am not validatong a session id.
The parameter is the key of the table department. His name is: id
Then after the message:

	Thread-14/AbstractValidatorAction: Validating parameter: id
	Thread-14/AbstractValidatorAction: Validating long parameter id (encoded in a 
string: true)
	Thread-14/FormValidatorAction: Validation failed for parameter id

What is wrong? As you can see the form validator tell me the id parameter 
failed.

Antonio Gallardo


El Domingo, 18 de Agosto de 2002 03:25, Christian Haul escribió:
> On 18.Aug.2002 -- 01:09 AM, Antonio Gallardo Rivera wrote:
> > I am trying the tutorial example that comes with Cocoon.
> >
> > When I try to create a employe or update a department. I always get this
> > error in the sitemap.log file:
> >
> > Thread-14/AbstractValidatorAction: Validating long parameter department
> > (encoded in a string: true)
> >
> > Then, my question is: How I can send a parameter of type "long" in a
> > request string? Is there another method todo that?
>
> This is no error but a debug message (change log level to turn it off). It
> says that the value is passed as a java instance of String. This is correct
> for request parameters as they are indeed strings.
> In case you were validating e.g. session attributes, they would not be
> encoded as Strings but be of the required type.
>
> So, if form validation fails, it has another cause. Usually, it says
> "validating parameter foo, foo should (something) and it (is / does) not."
>
> HTH.
> 	Chris.
>
> Please follow up summarizing your problem and which suggested solution
> / information worked for you when you consider your problem
> solved. Add "SUMMARY: " to the subject line. This will make FAQ
> generation and searching the list easier. In addition, it makes
> helping you more fun. Thank you.

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


Re: How to send a parameter of type "long" to a FormValidator

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 18.Aug.2002 -- 04:53 AM, Antonio Gallardo Rivera wrote:
> Can be the problem of update in the tutorial this?
> 
> <key dbcol="department_id" mode="manual" param="id" type="long"/>
> 
> Please see the mode attribute.

This is not related to form validation but to the database actions from
the modular package. The given mode creates a new autoincrement value
by querying the database for the current max value and adds 1 to it.

	Chris.

Please follow up summarizing your problem and which suggested solution
/ information worked for you when you consider your problem
solved. Add "SUMMARY: " to the subject line. This will make FAQ
generation and searching the list easier. In addition, it makes
helping you more fun. Thank you.

-- 
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/faq/index.html>

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


Re: How to send a parameter of type "long" to a FormValidator

Posted by Antonio Gallardo Rivera <ag...@agsoftware.dnsalias.com>.
Can be the problem of update in the tutorial this?

<key dbcol="department_id" mode="manual" param="id" type="long"/>

Please see the mode attribute.

Antonio Gallardo

El Domingo, 18 de Agosto de 2002 03:25, Christian Haul escribió:
> On 18.Aug.2002 -- 01:09 AM, Antonio Gallardo Rivera wrote:
> > I am trying the tutorial example that comes with Cocoon.
> >
> > When I try to create a employe or update a department. I always get this
> > error in the sitemap.log file:
> >
> > Thread-14/AbstractValidatorAction: Validating long parameter department
> > (encoded in a string: true)
> >
> > Then, my question is: How I can send a parameter of type "long" in a
> > request string? Is there another method todo that?
>
> This is no error but a debug message (change log level to turn it off). It
> says that the value is passed as a java instance of String. This is correct
> for request parameters as they are indeed strings.
> In case you were validating e.g. session attributes, they would not be
> encoded as Strings but be of the required type.
>
> So, if form validation fails, it has another cause. Usually, it says
> "validating parameter foo, foo should (something) and it (is / does) not."
>
> HTH.
> 	Chris.
>
> Please follow up summarizing your problem and which suggested solution
> / information worked for you when you consider your problem
> solved. Add "SUMMARY: " to the subject line. This will make FAQ
> generation and searching the list easier. In addition, it makes
> helping you more fun. Thank you.

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


Re: How to send a parameter of type "long" to a FormValidator

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 18.Aug.2002 -- 01:09 AM, Antonio Gallardo Rivera wrote:
> I am trying the tutorial example that comes with Cocoon.
> 
> When I try to create a employe or update a department. I always get this error 
> in the sitemap.log file:
> 
> Thread-14/AbstractValidatorAction: Validating long parameter department 
> (encoded in a string: true)
> 
> Then, my question is: How I can send a parameter of type "long" in a request 
> string? Is there another method todo that?

This is no error but a debug message (change log level to turn it off). It says
that the value is passed as a java instance of String. This is correct for request
parameters as they are indeed strings.
In case you were validating e.g. session attributes, they would not be encoded as
Strings but be of the required type.

So, if form validation fails, it has another cause. Usually, it says "validating
parameter foo, foo should (something) and it (is / does) not."

HTH.
	Chris.

Please follow up summarizing your problem and which suggested solution
/ information worked for you when you consider your problem
solved. Add "SUMMARY: " to the subject line. This will make FAQ
generation and searching the list easier. In addition, it makes
helping you more fun. Thank you.

-- 
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/faq/index.html>

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