forked from Coded/SIPRP
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							58 lines
						
					
					
						
							1.6 KiB
						
					
					
				
			
		
		
	
	
							58 lines
						
					
					
						
							1.6 KiB
						
					
					
				/*
 | 
						|
 * RequestServlet.java
 | 
						|
 *
 | 
						|
 * Created on 4 de Março de 2005, 18:19
 | 
						|
 */
 | 
						|
 | 
						|
package siprp.pagina;
 | 
						|
 | 
						|
import java.io.*;
 | 
						|
import java.util.*;
 | 
						|
 | 
						|
import javax.servlet.*;
 | 
						|
import javax.servlet.http.*;
 | 
						|
 | 
						|
/**
 | 
						|
 *
 | 
						|
 * @author  psantos
 | 
						|
 */
 | 
						|
public class RecruitServlet extends MailerServlet
 | 
						|
{
 | 
						|
	private final static String REC_FUNCAO = "rec_funcao";
 | 
						|
	private final static String REC_NOME = "rec_nome";
 | 
						|
	private final static String REC_MORADA = "rec_morada";
 | 
						|
	private final static String REC_TELEFONE = "rec_telefone";
 | 
						|
	private final static String REC_EMAIL = "rec_email";
 | 
						|
	private final static String REC_CV = "rec_cv";
 | 
						|
 | 
						|
	private final static String[] FORM_FIELDS = new String[]{
 | 
						|
								REC_FUNCAO, REC_NOME, REC_MORADA, 
 | 
						|
								REC_TELEFONE, REC_EMAIL, REC_CV
 | 
						|
							};
 | 
						|
 | 
						|
	public void doPost( HttpServletRequest req, HttpServletResponse res )
 | 
						|
	throws IOException
 | 
						|
	{
 | 
						|
		ServletOutputStream out = res.getOutputStream();
 | 
						|
		res.setContentType( "text/html" );
 | 
						|
 | 
						|
		Hashtable parameters = parseParameters( new Hashtable( req.getParameterMap() ) );
 | 
						|
 | 
						|
		String content = createContent( parameters, FORM_FIELDS, "mail/envio_cv.txt" );
 | 
						|
 | 
						|
		String from = ( String ) parameters.get( REC_EMAIL );
 | 
						|
		String email = DEFAULT_EMAIL;
 | 
						|
		if( PROPERTIES != null && PROPERTIES.containsKey( EMAIL_RECRUTAMENTO ) )
 | 
						|
		{
 | 
						|
			email = ( String ) PROPERTIES.get( EMAIL_RECRUTAMENTO );
 | 
						|
		}
 | 
						|
		String destination = email;
 | 
						|
		String subject = "Envio de CV através do site www.siprp.pt";
 | 
						|
		// manda mail
 | 
						|
		boolean success = sendMail( from, destination, subject, content, false );
 | 
						|
 | 
						|
		// mostra pagina correspondente
 | 
						|
		out.println( showResultPage( success, "mail/pedido_enviado.html", "mail/pedido_nao_enviado.html" ) );
 | 
						|
	}
 | 
						|
}
 |