Check-in [b021423766]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:modelo de destino y algo mas
Timelines: family | ancestors | descendants | both | busqueda_paquetes
Files: files | file ages | folders
SHA1:b02142376638c572bfe6ee781509cac1ef9e7e3a
User & Date: caleb 2015-01-10 22:33:26
Context
2015-01-11
12:40
modelo de destino y agregado jsp Leaf check-in: e2553370c7 user: caleb tags: busqueda_paquetes
2015-01-10
22:33
modelo de destino y algo mas check-in: b021423766 user: caleb tags: busqueda_paquetes
2015-01-09
02:06
busqueda paquetes check-in: 2c8484bbdb user: caleb tags: busqueda_paquetes
Changes

Added src/action/DestinoAction.java.



























































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package action;

import java.io.File;
import java.io.Serializable;
import java.util.List;

import org.apache.commons.io.IOUtils;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

import negocio.DestinoService;
import negocio.DestinoServiceDAO;
import model.Destino;

public class DestinoAction extends ActionSupport implements Preparable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private List<Destino> destinos;
	
	private Destino destino = new Destino();
	
	private File imagen;

	private DestinoService destinoService = new DestinoServiceDAO();

	public List<Destino> getDestinos() {
		return destinos;
	}

	public void setDestinos(List<Destino> destinos) {
		this.destinos = destinos;
	}

	public Destino getDestino() {
		return destino;
	}

	public void setDestino(Destino destino) {
		this.destino = destino;
	}

	public File getImagen() {
		return imagen;
	}

	public void setImagen(File imagen) {
		this.imagen = imagen;
	}

	public DestinoService getDestinoService() {
		return destinoService;
	}

	public void setDestinoService(DestinoService destinoService) {
		this.destinoService = destinoService;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	public String buscar()throws Exception{
		destinos=destinoService.buscar(destino);
		return SUCCESS;
	}

	@Override
	public void prepare() throws Exception {
		// TODO Auto-generated method stub
		
	}
}

Added src/model/Destino.java.







































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package model;

import java.io.Serializable;

public class Destino implements Serializable{

	
	private static final long serialVersionUID = 1L;


	private int codigo;
	private String nombre;
	private int ubigeo_id;
	private String descripcion;
	private byte[] imagen;


	public int getCodigo() {
		return codigo;
	}
	public void setCodigo(int codigo) {
		this.codigo = codigo;
	}
	public String getNombre() {
		return nombre;
	}
	public void setNombre(String nombre) {
		this.nombre = nombre;
	}
	public int getUbigeo_id() {
		return ubigeo_id;
	}
	public void setUbigeo_id(int ubigeo_id) {
		this.ubigeo_id = ubigeo_id;
	}
	public String getDescripcion() {
		return descripcion;
	}
	public void setDescripcion(String descripcion) {
		this.descripcion = descripcion;
	}
	public byte[] getImagen() {
		return imagen;
	}
	public void setImagen(byte[] imagen) {
		this.imagen = imagen;
	}

	
	
}

Added src/negocio/DestinoService.java.























>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
package negocio;

import java.util.List;

import model.Destino;

public interface DestinoService {

	List<Destino> buscar(Destino destino) throws Exception;

}

Added src/negocio/DestinoServiceDAO.java.











































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package negocio;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import persintencia.mybatis.mapper.DestinoMapper;
import util.MyBatisUtil;
import model.Destino;

public class DestinoServiceDAO implements DestinoService{

	@Override
	public List<Destino> buscar(Destino destino) throws Exception {
		SqlSession session=MyBatisUtil.getSqlSessionFactory().openSession();
		DestinoMapper destinoMapper=session.getMapper(DestinoMapper.class);
		List<Destino>destinos=destinoMapper.buscar(destino);
		return null;
	}

}

Added src/persintencia/mybatis/mapper/DestinoMapper.java.























>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
package persintencia.mybatis.mapper;

import java.util.List;

import model.Destino;

public interface DestinoMapper {

	List<Destino> buscar(Destino destino);

}

Added src/struts-destino.xml.



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
<?xml version="1.0" encoding="UTF-8"?>

<struts>
	<package name="struts-destino" extends="demo" namespace="/destino">	
	
		<action name="buscarDestion" class="action.DestinoAction"
			method="buscar">
			<result type="tiles">d_nacional_web</result>
			<result name="input" type="tiles">d_nacional_web</result>
		</action>

	</package>
</struts>

Changes to src/struts.xml.

8
9
10
11
12
13
14

15
16
17
18
19
20
21
	<constant name="struts.custom.i18n.resources" value="recursos.textos" />
	<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
	 			
	<include file="struts-admin.xml"/>
	<include file="struts-cliente.xml"/>
	<include file="struts-reserva.xml"/>
	<include file="struts-web.xml"/>

    
	<package name="demo" extends="struts-default">
		<result-types>
			<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"></result-type>
		</result-types>
		
		<interceptors>







>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
	<constant name="struts.custom.i18n.resources" value="recursos.textos" />
	<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
	 			
	<include file="struts-admin.xml"/>
	<include file="struts-cliente.xml"/>
	<include file="struts-reserva.xml"/>
	<include file="struts-web.xml"/>
    <include file="struts-destino.xml"/>
    
	<package name="demo" extends="struts-default">
		<result-types>
			<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"></result-type>
		</result-types>
		
		<interceptors>