Package action

Source Code of action.ContactActionBean

/*import bo.Mesaj;
import dao.MesajDao;
import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.action.Resolution;
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package action;

import bo.Mesaj;
import dao.MesajDao;
import daoI.IMesajDao;
import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.action.Resolution;

public class ContactActionBean extends BaseActionBean {

    private String nume;
    private String email;
    private String telefon;
    private String mesaj;

    @DefaultHandler
    public Resolution view() {
        return new ForwardResolution("/WEB-INF/jsp/contact.jsp");
    }

    public Resolution submit() {
        Mesaj msj = new Mesaj();
        msj.setEmail(getEmail());
        msj.setMesaj(getMesaj());
        msj.setTelefon(getTelefon());
        msj.setNume(getNume());

        IMesajDao mesajDao = new MesajDao();
        mesajDao.adaugaMesaj(msj);
        return new ForwardResolution("/WEB-INF/jsp/contact.jsp");
    }

    public Resolution reset() {
        return new ForwardResolution("/WEB-INF/jsp/contact.jsp");
    }

    public String getNume() {
        return nume;
    }

    public void setNume(String nume) {
        this.nume = nume;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getTelefon() {
        return telefon;
    }

    public void setTelefon(String telefon) {
        this.telefon = telefon;
    }

    public String getMesaj() {
        return mesaj;
    }

    public void setMesaj(String mesaj) {
        this.mesaj = mesaj;
    }
}
TOP

Related Classes of action.ContactActionBean

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.