cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elvenfire <>
Subject How to retrive data from a form and save to database
Date Mon, 29 Jun 2009 08:49:57 GMT

Hi everyone, 

I am using Apache cocoon 2.2,  hibernate and spring with mysql database.

I just want to know how could i retrieve an input and save it to database.
Kindly correct my codes

here's my jx.xml code:
<form method="post" action="${}">
	Last Name: <input type="text" name="last_name"/>
	 func,newPerson Save Person 

function newPerson() {
	var demoBean = cocoon.getComponent("demo");
	var lastName = cocoon.request.get("last_name");
	var person = demoBean.getNewPerson(lastName);
	cocoon.sendPage("page,createPerson", {"person" : person});
    public String getNewPerson(String lastName) {
	  Person p = new Person();
        Session s = Cewf.getInstance().getHibernateSession();;
        return ("Person #" + p.getPersonId() + " at " + p.getLastName());

I can save to the database but I do not know how to retrieve the parameter
from the user's input.

Thanks :) :working:

View this message in context:
Sent from the Cocoon - Users mailing list archive at

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

View raw message