forked from Coded/SIPRP
				
			no message
	
		
	
				
					
				
			git-svn-id: https://svn.coded.pt/svn/SIPRP@503 bb69d46d-e84e-40c8-a05a-06db0d6337410'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
							parent
							
								
									abad2911cb
								
							
						
					
					
						commit
						914ccbb840
					
				| @ -0,0 +1,57 @@ | |||||||
|  | /* | ||||||
|  |  * 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" ) ); | ||||||
|  | 	} | ||||||
|  | } | ||||||
					Loading…
					
					
				
		Reference in new issue