<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5526881625641066309</id><updated>2012-02-06T04:08:16.906-08:00</updated><category term='Repositorios Maven'/><title type='text'>No todo el monte es orégano</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://notodoelmonteesoregano-xente.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5526881625641066309/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://notodoelmonteesoregano-xente.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Vicente</name><uri>http://www.blogger.com/profile/12634293635509173165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5526881625641066309.post-7012692513246058974</id><published>2009-05-18T08:19:00.000-07:00</published><updated>2009-05-18T09:08:26.847-07:00</updated><title type='text'>Filtros de javax.servlet</title><content type='html'>En este post se explica como crear un elemento que puede ser de gran utilidad para nuestras aplicaciones web como es el &lt;span style="font-weight: bold;"&gt;Filtro&lt;/span&gt; de la &lt;span style="font-style: italic;"&gt;Interfaz&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;javax.servlet.Filter&lt;/span&gt;. Con un filtro podemos indicar a nuestra aplicación web que realice una acción intermedia (que nosotros indiquemos como veremos a continuación) al flujo de trabajo de la aplicación.&lt;br /&gt;&lt;br /&gt;Para explicar su funcionamiento vamos a suponer que tenemos una aplicación desarrollada bajo el framework &lt;span style="font-weight: bold;"&gt;Struts&lt;/span&gt; y en la que tenemos la siguiente estructura de ficheros y paquetería:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;MiAplicacion&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;     - src&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;           - MiAplicacion.Action (Package)&lt;/span&gt;&lt;br /&gt;                &lt;span style="color: rgb(255, 204, 0);"&gt;- MyAction1 &lt;span style="color: rgb(255, 255, 255);"&gt;(Clase Action de Struts)&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(51, 204, 255);"&gt;- MiAplicacion.ActionForm (Package)&lt;/span&gt;&lt;br /&gt;                &lt;span style="color: rgb(255, 204, 0);"&gt;- MyActionForm &lt;span style="color: rgb(255, 255, 255);"&gt;(Clase Action Form de Struts)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;      - WebContent&lt;/span&gt;&lt;br /&gt;           - jsp&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;                  - index.jsp&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;span style="color: rgb(255, 255, 255);"&gt;(Pagina principal formulario con un campo de texto y un boton para enviar el valor del campo de texto al MyAction1, y que es recogido por MyActionForm)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;                  - welcome.jsp&lt;span style="color: rgb(0, 0, 0);"&gt; (Pagina a la que se redirecciona despues de llamar a MyAction1 y si el filtro no altera el flujo de trabajo de la aplicación)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;                &lt;span style="color: rgb(255, 204, 0);"&gt; - mensaje.jsp&lt;/span&gt; &lt;span style="color: rgb(255, 255, 255);"&gt;(Pagina que se mostrará cuando se cumpla cierta condicion en el filtro)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;            - WEB-INF&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(255, 204, 0);"&gt;             - struts-config.xml&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;                  - web.xml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Suponiendo que el mapeo de los Action y Action Form es correcto (se realiza en el fichero &lt;span style="font-weight: bold;"&gt;struts-config&lt;/span&gt;) vamos a declarar nuestro filtro en el proyecto, a implementar su código y a indicar la acción que realiza cuando se ejecute el filtro.&lt;br /&gt;&lt;br /&gt;Para ello, creamos una nueva clase (POJO) que implemente la interfaz &lt;span style="font-weight: bold;"&gt;javax.servlet.Filter&lt;/span&gt;,&lt;br /&gt;(en mi caso en el paquete: &lt;span style="color: rgb(51, 204, 255);"&gt;MiAplicacion.Filters&lt;/span&gt; quedando la estructura como &lt;span style="color: rgb(255, 204, 0);"&gt;MiAplicacion.FIlters.MiFiltro&lt;/span&gt;). Puesto que es una interfaz, nuestro IDE nos pedirá que declaremos los métodos obligatorios que debe contener nuestra clase &lt;span style="font-style: italic;"&gt;MiFiltro&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Observamos que entre los métodos existe uno que se llama &lt;span style="font-weight: bold;"&gt;doFilter&lt;/span&gt; que es el que contendrá el código donde se efectuará la acción del filtro:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="font-weight: bold;"&gt;public void&lt;/span&gt; doFilter(ServletRequest &lt;span style="color: rgb(255, 204, 0);"&gt;request&lt;/span&gt;, ServletResponse &lt;span style="color: rgb(255, 204, 0);"&gt;response&lt;/span&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;            FilterChain &lt;span style="color: rgb(255, 204, 0);"&gt;chain&lt;/span&gt;) &lt;span style="font-weight: bold;"&gt;throws&lt;/span&gt; IOException, ServletException&lt;/span&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;{...}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Nuestro código, por no complicar el programa y puesto que no es lo relevante en este post, simplemente recibirá un parámetro con un valor entero de la petición http por &lt;span style="font-weight: bold;"&gt;request&lt;/span&gt;&lt;br /&gt;lo comparará con cero y en caso de ser menor o mayor efectuará una u otra acción. A continuación se muestra más detalladamente:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="font-weight: bold;"&gt;public void&lt;/span&gt; doFilter(ServletRequest &lt;span style="color: rgb(255, 204, 0);"&gt;request&lt;/span&gt;, ServletResponse &lt;span style="color: rgb(255, 204, 0);"&gt;response&lt;/span&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;            FilterChain &lt;span style="color: rgb(255, 204, 0);"&gt;chain&lt;/span&gt;) &lt;span style="font-weight: bold;"&gt;throws&lt;/span&gt; IOException, ServletException&lt;/span&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;       //EL siguiente codigo es necesario ya que los parametros no son &lt;span style="font-weight: bold;"&gt;HttpServlet&lt;/span&gt; sino &lt;span style="font-weight: bold;"&gt;Servlet&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      HttpServletResponse servletResponse =&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;            (HttpServletResponse)response;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;        HttpServletRequest servletRequest =&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;            (HttpServletRequest)request;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;       /*&lt;br /&gt;       Si el parametro enviado desde la jsp "index.jsp" es cero =&gt; se sigue&lt;br /&gt;       el flujo de trabajo normal de la aplicación como si no existiese filtro.&lt;br /&gt;       En cambio, si el parámetro contiene un valor distinto de cero =&gt; Se&lt;br /&gt;       redirecciona a la página "mensaje.jsp" alterando el flujo de trabajo de&lt;br /&gt;       la aplicación.&lt;br /&gt;       */&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;        if(request.getAttribute("parametro")!=null &amp;amp;&amp;amp;&lt;br /&gt;                 &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;request.getAttribute("parametro")==0&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;)&lt;br /&gt;      {&lt;br /&gt;            chain.doFilter(request, response);&lt;br /&gt;      }&lt;br /&gt;      else&lt;br /&gt;      {&lt;br /&gt;           servletResponse.sendRedirect(servletRequest.getContextPath()+"/jsp/mensaje.jsp");&lt;br /&gt;      }&lt;br /&gt;           &lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;}//cierra método doFilter&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;Además de declarar nuestra clase del filtro e implementar el código que se va a ejecutar con el filtro, tenemos que indicar a la aplicación dónde va a ejecutarse nuestro filtro, es decir, en qué momento del flujo de trabajo queremos que se ejecute el código antes implementado. Para esto nos vamos al fichero &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 255, 255);"&gt;web.xml &lt;/span&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;e introducimos las siguientes etiquetas:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;web-app&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;    filter&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;        filter-name&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);"&gt;mifiltro&lt;/span&gt; &lt;span style="color: rgb(51, 204, 255);"&gt;/filter-name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;        filter-class&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);"&gt;MiAplicacion.Filters.MiFiltro&lt;/span&gt; &lt;span style="color: rgb(51, 204, 255);"&gt;/filter-class&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;    /filter&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;    filter-mapping&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;        filter-name&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);"&gt;mifiltro&lt;/span&gt; &lt;span style="color: rgb(51, 204, 255);"&gt;/filter-name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;        url-pattern&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);"&gt;*.do&lt;/span&gt; &lt;span style="color: rgb(51, 204, 255);"&gt;/url-pattern&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;    /filter-mapping&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Con estas etiquetas, por un lado declaramos la existencia de nuestro filtro en la aplicación (etiqueta &lt;span style="font-weight: bold; color: rgb(51, 204, 255);"&gt;filter&lt;/span&gt; con nombre del bean del filtro y clase del filtro), y por otro lado dónde queremos que se ejecute el filtro dentro del flujo de trabajo de nuestra aplicación(etiqueta &lt;span style="color: rgb(51, 204, 255); font-weight: bold;"&gt;filter-mapping &lt;/span&gt;con el nombre del bean del filtro al que hacemos referencia y &lt;span style="font-weight: bold; color: rgb(51, 204, 255);"&gt;url-pattern&lt;/span&gt; que indica que el filtro se ejecutará &lt;span style="font-weight: bold; color: rgb(51, 255, 51);"&gt;ANTES&lt;/span&gt; de cualquiera llamada a un fichero &lt;span style="font-weight: bold; color: rgb(204, 0, 0);"&gt;(loquesea=*)loquesea.do&lt;/span&gt; , es decir, un Action de nuestra aplicación).&lt;br /&gt;&lt;br /&gt;Otra posible configuración podría ser poner en la etiqueta &lt;span style="font-weight: bold; color: rgb(51, 204, 255);"&gt;url-pattern&lt;/span&gt; el contenido&lt;span style="color: rgb(204, 0, 0);"&gt; &lt;span style="font-weight: bold;"&gt;*.jsp&lt;/span&gt;&lt;/span&gt;, coin lo que estariamos indicando que el filtro deberá ejecutarse &lt;span style="font-weight: bold; color: rgb(51, 255, 51);"&gt;ANTES&lt;/span&gt; de una llamada a un fichero de tipo &lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;loquesea.jsp&lt;/span&gt;, es decir una página jsp.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5526881625641066309-7012692513246058974?l=notodoelmonteesoregano-xente.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://notodoelmonteesoregano-xente.blogspot.com/feeds/7012692513246058974/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://notodoelmonteesoregano-xente.blogspot.com/2009/05/filtros-de-javaxservlet.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5526881625641066309/posts/default/7012692513246058974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5526881625641066309/posts/default/7012692513246058974'/><link rel='alternate' type='text/html' href='http://notodoelmonteesoregano-xente.blogspot.com/2009/05/filtros-de-javaxservlet.html' title='Filtros de javax.servlet'/><author><name>Vicente</name><uri>http://www.blogger.com/profile/12634293635509173165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5526881625641066309.post-4970006643146314718</id><published>2009-05-17T12:35:00.001-07:00</published><updated>2009-05-17T12:35:40.324-07:00</updated><title type='text'>Entrada de Prueba</title><content type='html'>Esta es una entrada de prueba&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5526881625641066309-4970006643146314718?l=notodoelmonteesoregano-xente.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://notodoelmonteesoregano-xente.blogspot.com/feeds/4970006643146314718/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://notodoelmonteesoregano-xente.blogspot.com/2009/05/entrada-de-prueba.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5526881625641066309/posts/default/4970006643146314718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5526881625641066309/posts/default/4970006643146314718'/><link rel='alternate' type='text/html' href='http://notodoelmonteesoregano-xente.blogspot.com/2009/05/entrada-de-prueba.html' title='Entrada de Prueba'/><author><name>Vicente</name><uri>http://www.blogger.com/profile/12634293635509173165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5526881625641066309.post-6251254369864284433</id><published>2009-05-17T08:56:00.000-07:00</published><updated>2009-05-18T12:12:30.953-07:00</updated><title type='text'>Múltiples struts-config.xml en mi aplicación</title><content type='html'>En este post trato de explicar la forma de utilizar varios ficheros de configuración del framework &lt;span style="font-weight: bold;"&gt;Struts&lt;/span&gt; en nuestro proyecto de aplicación web.&lt;br /&gt;&lt;br /&gt;Si tenéis una aplicación desarrollada bajo el framework Struts y que contiene un gran número de clases de tipo &lt;span style="font-weight: bold;"&gt;Action&lt;/span&gt; de Struts sobre todo, y a la hora de realizar el mapeo de estas clases en vuestro fichero &lt;span style="font-weight: bold;"&gt;struts-config.xml&lt;/span&gt;, os resulta un tanto difícil la comprensión o la búsqueda de las etiquetas &lt;span style="font-weight: bold;"&gt;&lt;action&gt;&lt;/action&gt;&lt;/span&gt;, para facilitar la gestión del fichero podemos optar por:&lt;br /&gt;&lt;br /&gt;1) Crer una lista de multiples strut-config separada por comas.&lt;br /&gt;2) Modularizar nuestra aplicación, dividiéndola en distintos módulos para su configuración.&lt;br /&gt;&lt;br /&gt;La opción &lt;span style="font-weight: bold;"&gt;(1)&lt;/span&gt;, puede ser la alternativa más rápida puesto que sólo necesita crear un nuevo fichero de configuración (&lt;span style="font-weight: bold;"&gt;struts-config-nuevo.xml&lt;/span&gt;) e incluir la parte que queramos del mapeo, que ya teníamos en nuestro fichero &lt;span style="font-weight: bold;"&gt;strut-config.xml&lt;/span&gt; inicial o por defecto.&lt;br /&gt;&lt;br /&gt;A continuación mostramos un ejemplo de cómo hacerlo:&lt;br /&gt;&lt;br /&gt;Por un lado tenemos el fichero &lt;span style="font-weight: bold;"&gt;struts-config.xml&lt;/span&gt; sin dividir, es decir, con todos los Action de nuestra aplicación mapeados:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;struts-config&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  data-sources&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  /data-sources&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  form-beans&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;      form-bean name=&lt;/span&gt;"formbean" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;          &lt;span style="color: rgb(51, 204, 255);"&gt;type&lt;/span&gt;="es.nodotodoelmonteesoregano.actionform.MyActionForm"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;      /form-bean&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  /form-beans&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt; &lt;span style="color: rgb(51, 204, 255);"&gt; global-exceptions&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  /global-exceptions&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  global-forwards&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  /global-forwards&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  action-mappings&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;      action path&lt;/span&gt;="/myAction1" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;            &lt;span style="color: rgb(51, 204, 255);"&gt;type&lt;/span&gt;="es.nodotodoelmonteesoregano.action.MyAction1" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;           &lt;span style="color: rgb(51, 204, 255);"&gt; scope&lt;/span&gt;="request"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;      &lt;span style="color: rgb(51, 204, 255);"&gt;forward name&lt;/span&gt;="confirmacion" path="/jsp/ejemplo1.jsp"&lt;span style="color: rgb(51, 204, 255);"&gt;/forward&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;    &lt;span style="color: rgb(51, 204, 255);"&gt;/action&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;    &lt;span style="color: rgb(51, 204, 255);"&gt;action path&lt;/span&gt;="/myAction2" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;           &lt;span style="color: rgb(51, 204, 255);"&gt; type&lt;/span&gt;="es.nodotodoelmonteesoregano.action.MyAction2"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;           &lt;span style="color: rgb(51, 204, 255);"&gt; name&lt;/span&gt;="formbean" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;           &lt;span style="color: rgb(51, 204, 255);"&gt; scope&lt;/span&gt;="request"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;     &lt;span style="color: rgb(51, 204, 255);"&gt; forward name&lt;/span&gt;="confirmacion" path="/jsp/ejemplo2.jsp" &lt;span style="color: rgb(51, 204, 255);"&gt;/forward&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;    /action&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt; &lt;span style="color: rgb(51, 204, 255);"&gt; /action-mappings&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;    ...&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;   &lt;span style="color: rgb(51, 204, 255);"&gt; (Resto de la configuracion del strut-config que tengais)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;    ...&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;Ahora vamos a proceder a divir nuestro mapeo del fichero &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 255, 255);"&gt;struts-config.xml &lt;/span&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;en 2 ficheros:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: center;"&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;1º)&lt;/span&gt;&lt;span style="font-style: italic;"&gt; &lt;span style="color: rgb(255, 255, 255);"&gt;Fichero &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 255, 255);"&gt;struts-config.xml &lt;/span&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;anterior:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;struts-config&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  data-sources&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  /data-sources&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  form-beans&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&gt;&gt;&gt; AQUÍ YA NO ESTÁ EL MAPEO DEL ACTION FORM &lt;&lt;&lt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  /form-beans&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt; &lt;span style="color: rgb(51, 204, 255);"&gt; global-exceptions&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  /global-exceptions&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  global-forwards&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  /global-forwards&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  action-mappings&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;      action path&lt;/span&gt;="/myAction1" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;            &lt;span style="color: rgb(51, 204, 255);"&gt;type&lt;/span&gt;="es.nodotodoelmonteesoregano.action.MyAction1" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;           &lt;span style="color: rgb(51, 204, 255);"&gt; scope&lt;/span&gt;="request"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;      &lt;span style="color: rgb(51, 204, 255);"&gt;forward name&lt;/span&gt;="confirmacion" path="/jsp/ejemplo1.jsp"&lt;span style="color: rgb(51, 204, 255);"&gt;/forward&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;    &lt;span style="color: rgb(51, 204, 255);"&gt;/action&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&gt;&gt;&gt; AQUÍ YA NO ESTÁ EL MAPEO DEL 2º ACTION &lt;&lt;&lt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt; &lt;span style="color: rgb(51, 204, 255);"&gt; /action-mappings&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;    ...&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;   &lt;span style="color: rgb(51, 204, 255);"&gt; (Resto de la configuracion del strut-config que tengais)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;    ...&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;2º) &lt;/span&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;Fichero &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(255, 255, 255);"&gt;strut-config-nuevo.xml&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(255, 255, 255);"&gt;, en la misma ruta que el fichero &lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(255, 255, 255);"&gt;struts-config.xml&lt;/span&gt;:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;struts-config&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  data-sources&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  /data-sources&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  form-beans&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;      form-bean name=&lt;/span&gt;"formbean" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;          &lt;span style="color: rgb(51, 204, 255);"&gt;type&lt;/span&gt;="es.nodotodoelmonteesoregano.actionform.MyActionForm"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;      /form-bean&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  /form-beans&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt; &lt;span style="color: rgb(51, 204, 255);"&gt; global-exceptions&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  /global-exceptions&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  global-forwards&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  /global-forwards&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  action-mappings&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&gt;&gt;&gt; AQUÍ YA NO ESTÁ EL MAPEO DEL 1er ACTION &lt;&lt;&lt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;    &lt;span style="color: rgb(51, 204, 255);"&gt;action path&lt;/span&gt;="/myAction2" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;           &lt;span style="color: rgb(51, 204, 255);"&gt; type&lt;/span&gt;="es.nodotodoelmonteesoregano.action.MyAction1"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;           &lt;span style="color: rgb(51, 204, 255);"&gt; name&lt;/span&gt;="formbean" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;           &lt;span style="color: rgb(51, 204, 255);"&gt; scope&lt;/span&gt;="request"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;     &lt;span style="color: rgb(51, 204, 255);"&gt; forward name&lt;/span&gt;="confirmacion" path="/jsp/ejemplo2.jsp" &lt;span style="color: rgb(51, 204, 255);"&gt;/forward&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;    /action&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/action-mappings&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;    ...&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;   &lt;span style="color: rgb(51, 204, 255);"&gt; (Resto de la configuracion del strut-config que tengais)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;    ...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;3º) &lt;/span&gt;&lt;span style="font-style: italic; color: rgb(255, 255, 255);"&gt;También necesario para que nuestra aplicación reconozca que existen dos ficheros de configuración de struts, es indicar en nuestro fichero &lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(255, 255, 255);"&gt;web.xml&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(255, 255, 255);"&gt; que existen estos 2 ficheros, de la siguiente forma:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center; color: rgb(51, 204, 255);"&gt;web-app&lt;br /&gt;...&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;init-param&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;param-name &lt;/span&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;config&lt;/span&gt; &lt;span style="color: rgb(51, 204, 255);"&gt;/param-name&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;param-value&lt;br /&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;WEB-INF/struts-config.xml &lt;span style="color: rgb(255, 0, 0);"&gt;,&lt;/span&gt; /WEB-INF/struts-config-nuevo.xml&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/param-value&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/init-param&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/web-app&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 51);"&gt;&lt;span style="color: rgb(255, 102, 102);"&gt;&gt;&gt;&gt;&lt;/span&gt; ATENCIÓN A LA COMA (&lt;span style="color: rgb(255, 102, 102);"&gt;,&lt;/span&gt;) &lt;span style="color: rgb(255, 102, 102);"&gt;&lt;&lt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Con esto podemos tener más organizada nuestra aplicación y ayudar, sobretodo, a la hora de depurar y realizar siguimientos del flujo de trabajo que se efectúa en una aplicación implementada bajo el &lt;span style="font-weight: bold;"&gt;framework Struts&lt;/span&gt;.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;struts-config&gt;&lt;action-mappings&gt;&lt;action path="/verCalendario" type="es.soltel.calendariogoogle.action.calendario.CalendarioAction" scope="request"&gt;&lt;action path="/verBlog" type="es.soltel.calendariogoogle.action.blog.BlogAction" scope="request"&gt;&lt;forward name="confirmacion" path="/jsp/blog.jsp"&gt;&lt;/forward&gt;  &lt;/action&gt;&lt;/action&gt;&lt;/action-mappings&gt;&lt;/struts-config&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5526881625641066309-6251254369864284433?l=notodoelmonteesoregano-xente.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://notodoelmonteesoregano-xente.blogspot.com/feeds/6251254369864284433/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://notodoelmonteesoregano-xente.blogspot.com/2009/05/multiples-struts-configxml-en-mi.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5526881625641066309/posts/default/6251254369864284433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5526881625641066309/posts/default/6251254369864284433'/><link rel='alternate' type='text/html' href='http://notodoelmonteesoregano-xente.blogspot.com/2009/05/multiples-struts-configxml-en-mi.html' title='Múltiples struts-config.xml en mi aplicación'/><author><name>Vicente</name><uri>http://www.blogger.com/profile/12634293635509173165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5526881625641066309.post-6156935916945249496</id><published>2009-05-12T13:10:00.000-07:00</published><updated>2009-05-12T13:34:24.962-07:00</updated><title type='text'>Artifactory para crear nuestros repositorios</title><content type='html'>En este post vamos a explicar de manera rápida qué es y cómo instalar Artifactory para poder crear repositorios de dependencias para Maven.&lt;br /&gt;&lt;br /&gt;Artifactory es una herramienta que actúa como servidor de repositorios para Maven 2. Con su instalación podremos, entre otas cosas, crear repositorios de dependencias para Maven.&lt;br /&gt;&lt;br /&gt;Podemos descargarlo desde &lt;a href="http://www.jfrog.org/download.php"&gt;http://www.jfrog.org/download.php&lt;/a&gt; (En mi caso, he descargado el fichero .zip)&lt;br /&gt;&lt;br /&gt;Una vez descargado lo descomprimimos en alguna hubicación (En mi caso C:/, quedando &lt;span style="font-weight: bold;"&gt;C:\artifactory-2.0.5&lt;/span&gt;) .&lt;br /&gt;&lt;br /&gt;Por otro lado tendremos que crearnos una variable de entorno del sistema (&lt;span style="font-weight: bold;"&gt;ARTIFACTORY_HOME&lt;/span&gt;) y añadirla a la variable &lt;span style="font-weight: bold;"&gt;PATH&lt;/span&gt; del mismo.&lt;br /&gt;&lt;br /&gt;Por último cogemos el fichero con extensión &lt;span style="font-weight: bold;"&gt;.war&lt;/span&gt; que contiene la carpeta &lt;span style="font-weight: bold;"&gt;C:/artifactory-2.0.5/webapps &lt;/span&gt;(&lt;span style="font-weight: bold;"&gt;artifactory.war&lt;/span&gt;) y realizamos el despliegue de la aplicación, llevándolo a nuestro Tomcat.&lt;br /&gt;&lt;br /&gt;Ahora, si arrancáis Tomcat podéis acceder al gestor de repositorios con la url:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;http://localhost:8080/artifactory/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5526881625641066309-6156935916945249496?l=notodoelmonteesoregano-xente.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://notodoelmonteesoregano-xente.blogspot.com/feeds/6156935916945249496/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://notodoelmonteesoregano-xente.blogspot.com/2009/05/artifactory-para-crear-nuestros.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5526881625641066309/posts/default/6156935916945249496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5526881625641066309/posts/default/6156935916945249496'/><link rel='alternate' type='text/html' href='http://notodoelmonteesoregano-xente.blogspot.com/2009/05/artifactory-para-crear-nuestros.html' title='Artifactory para crear nuestros repositorios'/><author><name>Vicente</name><uri>http://www.blogger.com/profile/12634293635509173165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5526881625641066309.post-4393897311386804581</id><published>2009-05-12T11:39:00.001-07:00</published><updated>2009-05-12T12:46:50.333-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Repositorios Maven'/><title type='text'>Repositorios Maven</title><content type='html'>&lt;p&gt;En este post se explica cómo utilizar un repositorio propio de dependencias, para almacenar los ficheros .jar de nuestros proyectos Maven.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Maven mete los jar en determinados sitios de forma que queden accesibles para otros proyectos Maven. &lt;/p&gt;&lt;p&gt;Por un lado hay un &lt;b&gt;repositorio local&lt;/b&gt; de jars, en el mismo ordenador. Está en &lt;i&gt;$HOME/.m2/repository&lt;/i&gt;. Aquí se van guardando todos los jar que se bajan automáticamente de internet y los de mis proyectos cuando yo lo indico. Este repositorio sólo está accesible para un usuario en un ordenador. &lt;/p&gt;&lt;p&gt;Por otro lado está internet, en el que hay jars típicos (&lt;a href="http://www.chuidiang.com/chuwiki/index.php?title=Categor%C3%ADa:Log4j" title="Categoría:Log4j"&gt;log4j.jar&lt;/a&gt;, &lt;a href="http://www.chuidiang.com/chuwiki/index.php?title=Categor%C3%ADa:Junit" title="Categoría:Junit"&gt;junit.jar&lt;/a&gt;, etc). Maven se baja de allí los jar cuando los necesita y los guarda en nuestro repositorio local. &lt;/p&gt;&lt;p&gt;Podemos configurar además un respositorio para el equipo de trabajo, de forma que los jar "oficiales" del proyecto se guardan allí y están disponibles para todos los ordenadores y usuarios de ese equipo de trabajo. (Ver Como crear y gestionar repositorios con Artifactory)&lt;/p&gt;&lt;p&gt;Partimos de que tengamos creado un repositorio propio (puede hacerse con Artifactory), por ejemplo:&lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;pre&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="font-weight: bold;"&gt; &lt;span style="color: rgb(51, 204, 255);font-size:100%;" &gt;&lt;id&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;id&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);font-size:100%;" &gt;nombre_asignado_por_artifactory&lt;/span&gt;&lt;/span&gt;&lt;/id&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt; /id&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;nombre&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);"&gt;nombre_asignado_por_artifactory&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt; &lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/nombre&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;url&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);"&gt;http://localhost:8080/artifactory/nombre_repositorio&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/url&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="text-align: left;"&gt;Ahora tendremos que configurar el fichero &lt;span style="font-weight: bold;"&gt;settings.xml&lt;/span&gt; (Yo lo tengo en&lt;span style="font-style: italic;"&gt; "C:\apache-maven-2.1.0\conf") &lt;/span&gt;de Maven para la conexión con el repositorio, de manera que, editamos el fichero y añadimos las siguientes líneas dentro de la etiqueta &lt;span style="font-weight: bold;"&gt;&lt;servers&gt;&lt;/servers&gt;&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;div  style="text-align: center; font-weight: bold;font-family:courier new;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;span style="color: rgb(51, 204, 255);"&gt;server&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;span style="color: rgb(51, 204, 255);"&gt;id &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold; color: rgb(255, 204, 0);font-family:courier new;" &gt;nombre_asignado_por_artifactory&lt;/span&gt; &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/id&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;   &lt;span style="color: rgb(51, 204, 255);"&gt;   &lt;username&gt;&lt;/username&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;span style="color: rgb(51, 204, 255);"&gt;username &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;span style="color: rgb(255, 204, 0);"&gt;usuario_artifactory&lt;/span&gt;&lt;span style="color: rgb(51, 204, 255);"&gt; /&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;span style="color: rgb(51, 204, 255);"&gt;password&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;     &lt;span style="color: rgb(51, 204, 255);"&gt; &lt;password&gt;&lt;/password&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;password&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);"&gt;password_artifactory&lt;/span&gt;&lt;/span&gt;  &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/password&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/server&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;A continuación, configuramos el fichero &lt;span style="font-weight: bold;"&gt;pom.xml&lt;/span&gt; de nuestros proyectos para que por defecto genere los .jar en el repositorio que hemos creado y podamos compartirlo con los demás proyectos Maven, como antes se menciona. Editamos el fichero e introducimos:&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold; color: rgb(51, 204, 255);"&gt;&lt;project&gt;&lt;/project&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 204, 255); font-weight: bold;"&gt;project&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;   ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;   &lt;span style="color: rgb(51, 204, 255);"&gt;&lt;distributionmanagement&gt;&lt;/distributionmanagement&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 204, 255); font-weight: bold;"&gt;distributionManagement&lt;br /&gt;&lt;br /&gt;repository&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;         &lt;span style="color: rgb(51, 204, 255);"&gt;&lt;id&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;id&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);"&gt;nombre_asignado_por_artifactory&lt;/span&gt;&lt;/span&gt;&lt;/id&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt; /id&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;nombre&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);"&gt;nombre_asignado_por_artifactory&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt; &lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/nombre&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;url&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);"&gt;http://localhost:8080/artifactory/nombre_repositorio&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/url&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="color: rgb(51, 204, 255); font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;/repository&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;      &lt;span style="color: rgb(51, 204, 255);"&gt;&lt;snapshotrepository&gt;snapshotRepository&lt;br /&gt;&lt;br /&gt;  &lt;id&gt;&lt;/id&gt;&lt;/snapshotrepository&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;         &lt;span style="color: rgb(51, 204, 255);"&gt;&lt;id&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;id&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);"&gt;nombre_asignado_por_artifactory&lt;/span&gt;&lt;/span&gt;&lt;/id&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt; /id&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;nombre&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);"&gt;nombre_asignado_por_artifactory&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt; &lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/nombre&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;url&lt;/span&gt; &lt;span style="color: rgb(255, 204, 0);"&gt;http://localhost:8080/artifactory/nombre_repositorio&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/url&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/snapshotRepository&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="color: rgb(51, 204, 255); font-weight: bold;"&gt;/distributionManagement&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold; color: rgb(51, 204, 255);font-family:courier new;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;/project&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Una vez hecho esto, con&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:100%;"  &gt;mvn deploy&lt;/span&gt;, se generan los jar del proyecto y se guardan en el repositorio indicado en la etiqueta&lt;i&gt; &lt;/i&gt;&lt;span style="font-weight: bold; color: rgb(51, 204, 255);font-size:100%;" &gt;distributionManagement&lt;/span&gt;. &lt;/div&gt;&lt;/div&gt;&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5526881625641066309-4393897311386804581?l=notodoelmonteesoregano-xente.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://notodoelmonteesoregano-xente.blogspot.com/feeds/4393897311386804581/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://notodoelmonteesoregano-xente.blogspot.com/2009/05/repositorios-maven.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5526881625641066309/posts/default/4393897311386804581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5526881625641066309/posts/default/4393897311386804581'/><link rel='alternate' type='text/html' href='http://notodoelmonteesoregano-xente.blogspot.com/2009/05/repositorios-maven.html' title='Repositorios Maven'/><author><name>Vicente</name><uri>http://www.blogger.com/profile/12634293635509173165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5526881625641066309.post-3021809701171835378</id><published>2009-05-08T13:30:00.000-07:00</published><updated>2009-05-08T13:31:42.931-07:00</updated><title type='text'>Bienvenidos!</title><content type='html'>Hola amigos, conocidos, compañeros, familiares y demás personas que visitais este blog!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5526881625641066309-3021809701171835378?l=notodoelmonteesoregano-xente.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://notodoelmonteesoregano-xente.blogspot.com/feeds/3021809701171835378/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://notodoelmonteesoregano-xente.blogspot.com/2009/05/bienvenidos.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5526881625641066309/posts/default/3021809701171835378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5526881625641066309/posts/default/3021809701171835378'/><link rel='alternate' type='text/html' href='http://notodoelmonteesoregano-xente.blogspot.com/2009/05/bienvenidos.html' title='Bienvenidos!'/><author><name>Vicente</name><uri>http://www.blogger.com/profile/12634293635509173165</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
