cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garvin Riensche" <g.riens...@gmx.net>
Subject modular database actions
Date Wed, 03 Dec 2003 18:22:44 GMT
hi there,

i tried to create a simple example with modular database actions. the only
thing i want cocoon to do is to store a number from a form field into my
database. but it seems like cocoon doesn't propagate the input number from
the form to the action as i always get this error:

Could not add record

org.apache.cocoon.ProcessingException: Could not add record:
java.sql.SQLException: General error, message from server: "Column 'number'
cannot be null"

i am using cocoon 2.1m2 with mysql on windows xp.

the sitemap:

<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:components>
	<map:actions>
		<map:action name="add-number"
src="org.apache.cocoon.acting.modular.DatabaseAddAction">
			<descriptor>number.xml</descriptor>
			<throw-exception>true</throw-exception>
		</map:action>
	</map:actions>
</map:components>

<map:pipelines>
	<map:pipeline>
	<map:match pattern="start">
		<map:read src="input.html" mimy-type="text/html"/>
	</map:match>

	<map:match pattern="store-number">
		<map:act type="add-number">
			<map:parameter name="table-set" value="number"/>
			<map:read src="success.html" mimy-type="text/html"/>
		</map:act>
		<map:read src="error.html" mimy-type="text/html"/>
	</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>

number.xml:

<?xml version="1.0"?>
<root>
	<connection>MySQL</connection>
	<table name="numbers" alias="numbers">
		<keys>
			<key name="uid" type="int" autoincrement="true">
				<mode name="auto" type="autoincr"/>
			</key>
		</keys>

	<values>
		<value name="number" type="int"/>
	</values>
	</table>

	<table-set name="number">
		<table name="numbers"/>
	</table-set>
</root>

input.html:

<html>
<head>
</head>
<body>
	<form action="store-number" method="post">
		<h1>Number: </h1>
		<input name="number" type="int"/>
		<input type="submit" value="ok"/>
	</form>
</body>
</html>

My database table consists of 2 rows: "uid" as primary key and "number".

It would be great if someone could help.


regards,
Garvin


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


Mime
View raw message