playframework - Save contact form details in DB in a Play 1.2.5 app -
i want save contact details of people try contact me on website. i'm using temporarily in memory db
below code i'm using, giving me "not found post /addcontact" error when hit submit.
routes :
get / application.index
get /our-works application.ourworks
get /contact-us application.contactus
get /about-us application.aboutus
get /plans application.plans
post /contact-us application.addcontact
controller :
public static void addcontact(string name, string phone, string email, string query) { contact contact = new contact(); contact.name = name; contact.phone = phone; contact.email = email; contact.query = query; contact.save(); }
model :
@entity public class contact extends model {
@id public string id; public string name; public string phone; public string email; public string query;
}
... html code:
<form action="/addcontact" method="post">
Comments
Post a Comment