sábado, 22 de diciembre de 2007
VivaLinux! Video: LinuxMCE 0704
VivaLinux! � Video: LinuxMCE 0704
lunes, 17 de diciembre de 2007
OpenProj | Projity
Además este software esta realizado en java por lo que es multiplataforma.
Probablemente el mejor sustituto libre para MS Project ya que podemos abrir este tipo de ficheros.
OpenProj | Projity
viernes, 14 de diciembre de 2007
Automatizar la generación de stub y skeleton con Rmic en NetBeans
Para ello nos vamos al directorio principal de nuestro proyecto y editamos el fichero build.xml
En la parte final de este fichero ponemos la siguiente tarea de ant:
<target name="-post-compile">
<rmic stubversion="compat" base="${build.classes.dir}" includes="**/ServidorRMI.class"/>
</target>
Así justo despues de compilar NetBeans ejecutara rmic con las opciones que le hemos pasado en la tarea de ant.
Rmic Task
miércoles, 12 de diciembre de 2007
UNLOCKER 1.8.5 BY CEDRICK 'NITCH' COLLOMB
UNLOCKER 1.8.5 BY CEDRICK 'NITCH' COLLOMB
Notebook BatteryInfo
http://www.batteryinfo.de.vu/
sábado, 3 de noviembre de 2007
Microsoft SharedView Beta 2
Este software tiene las siguientes características:
- Para poder crear una sesión de SharedView se necesita un Windows Live Passport, pero no para unirse a ella.
- Pueden unirse hasta 15 personas.
- Podrás compartir, revisar y actualizar documentos con muchas personas en tiempo real.
Aquí puedes ver los requerimientos para ejecutar SharedView
miércoles, 19 de septiembre de 2007
Permitir autentificación de windows en Firefox para el acceso a una intranet SharePoint
C:\Archivos de programa\Mozilla Firefox\greprefs\all.js
Dentro de este fichero editamos la propiedad:
pref("network.automatic-ntlm-auth.trusted-uris", "");
De manera que en ella aparezca la dirección de nuestra intranet basada en SharePoint:
pref("network.automatic-ntlm-auth.trusted-uris", "http://fileserver");
Tras ello reiniciamos Firefox y ya podemos acceder a la intranet con nuestro usuario de windows sin tener que escribir el usuario y contraseña de nuevo.
Hay que tener cuidado pues con las actualizaciones mayores de Firefox este fichero es sustituido por el que viene por defecto con Firefox, por tanto perderíamos esta configuración.
lunes, 10 de septiembre de 2007
CONFIGURACIÓN DE DATASOURCE PARA TOMCAT 5.5 Y MYSQL 5.0.22
Paso 1 - Copiamos nuestro driver JDBC para mysql de extensión *.jar a la ruta $CATALINA_HOME/common/lib del tomcat en mi caso
el fichero es mysql-connector-java-5.0.5-bin.jar. Reiniciar tomcat.
Paso 2 - Si aun no lo hemos hecho, hay que crear en mysql un usuario con contraseña (sino tiene contraseña la conexión va a
fallar), una base de datos y un tabla con datos a la que acceder.
Paso 3- Configurar el web.xml de nuestra aplicación web.
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xsi="http://www.w3.org/2001/XMLSchema-instance" schemalocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<description>MySQL Test App</description>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/TestDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
Paso 3- Añadir nuestro código de conexión a la aplicación:
//Con DataSource
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/TestDB");
con = ds.getConnection();
DriverManager.setLogWriter(new PrintWriter(System.out, true));
if ( ds == null ) {
throw new Exception("Data source no encontrado!");
}
Paso 4 - Tras realizar el desplegado de la aplicación en tomcat nos vamos a la aplicación de administración de tomcat. Una vez autenticados nos vamos a la siguiente ruta del arbol:
Tomcat Server->Servicio Catalina->Host(Localhost)->Context(/nombreDeLaAplicacion)->Recursos->Fuentes de datos.
En esta ruta nos tiene que aparecer el nombre de nuestro datasource pues lo hemos puesto en el web.xml. Sin embargo no esta configurado (todos los campos menos el nombre estan vacios). Lo configuramos con los siguientes parametros.
<resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource" maxactive="100" maxidle="30" maxwait="10000" username="javauser" password="javadude" driverclassname="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>
Paso 5- Tras ello entramos en nuestra aplicación y la conexión con la bd tiene que realizarse correctamente.
lunes, 3 de septiembre de 2007
TugZip, compresor SQX
http://www.tugzip.com/
martes, 31 de julio de 2007
Diseñando espacios colaborativos para aumentar la productividad
En este artículo nos sacan de dudas.
lunes, 30 de julio de 2007
OpenSwing - framework libre para el desarrollo de aplicaciones Swing
OpenSwing también cuenta con una librería para el desarrollo de la capa de acceso a datos y (para las aplicaciones de tres capas) la lógica de negocio, así como una librería que se encarga de simplificar la comunicación con el servidor. También cuenta con componentes para visualizar documentos PDF, Excel, csv, HTML, XML, RTF. El framework se distribuye bajo licencia LGPL y cuenta con abundante documentación entre la cual se incluyen varias aplicaciones de demostración.
http://oswing.sourceforge.net/
http://www.javahispano.org/news.item.action?id=1591638492
lunes, 23 de julio de 2007
Interesante y didáctico artículo sobre JPA
Using the Java Persistence API in Desktop Applications
miércoles, 27 de junio de 2007
Programas de gestión para autónomos y pymes
On-Line
Endeve
Factusyn: programa de facturación online
Galopin: SINUH
proyecto Open Bravo
Araña Gestión
Off-Line
GestiCam
FacturaLux
BulmaGes
Fisterra
Programas de gestión para autónomos y pymes
Error en PHP_NUKE "The html tags you attempted to use are not allowed"
The html tags you attempted to use are not allowed
es por que estamos incluyendo alguna etiqueta html no permitida.
Para solucionar esto nos vamos al fichero mainfile.php y comentamos las siguientes lineas (que implementan el filtro):
foreach ($_GET as $secvalue) {
if ((eregi("<[^>]*script*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*object*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*iframe*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*applet*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*meta*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*style*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*form*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*img*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*onmouseover*\"?[^>]*>", $secvalue)) ||
(eregi("\([^>]*\"?[^)]*\)", $secvalue)) ||
(eregi("\"", $secvalue)) ||
(eregi("forum_admin", $var_name)) ||
(eregi("inside_mod", $var_name))) {
die ("

The html tags you attempted to use are not allowed
[ Go Back ]");
}
}
foreach ($_POST as $secvalue) {
if ((eregi("<[^>]*onmouseover*\"?[^>]*>", $secvalue)) || (eregi("<[^>]*script*\"?[^>]*>", $secvalue)) || (eregi("<[^>]*style*\"?[^>]*>", $secvalue))) {
die ("

The html tags you attempted to use are not allowed
[ Go Back ]");
}
}
Tras comentar estas lineas ya podemos enviar noticias con cualquier tipo de etiqueta html.
Reproductor flash tipo youtube jw mp3 player
Es altamente configurable por lo que nos permite poner audio a nuestra página web sin necesidad de descargar un archivo mp3.
http://www.jeroenwijering.com/?item=JW_MP3_Player
domingo, 24 de junio de 2007
Windows SteadyState, administre los equipos de un laboratorio de equipos escolar o un cibercafé, una biblioteca o incluso en casa
Windows SteadyState se ejecuta en copias originales de Windows XP Professional, Windows XP Home Edition y Windows XP Tablet PC Edition. Además, Windows SteadyState se ofrece de manera gratuita a los clientes del Programa de Ventajas de Windows Original.
Windows SteadyState facilita la administración de los equipos compartidos
Los equipos compartidos se encuentran normalmente en escuelas, cibercafés y salones de juego, bibliotecas y centros de la comunidad. Cada vez es más común que los propietarios, profesores o personal no técnico administren equipos compartidos además de sus muchas otras responsabilidades.
La administración de equipos compartidos puede suponer un reto técnico complejo, laborioso y costoso. Es más, si no se protege ni se aplican restricciones al sistema, los usuarios pueden cambiar de manera accidental la apariencia del escritorio, modificar valores del sistema, y dar entrada a software, virus y otros programas perjudiciales. La reparación de equipos compartidos dañados puede requerir mucho tiempo y esfuerzo.
La privacidad del usuario también supone un problema para entornos de equipos compartidos. Los equipos compartidos usan a menudo cuentas de usuario compartidas que dejan accesibles el historial de Internet, los documentos guardados y las páginas web almacenadas en caché a los usuarios posteriores.
Windows SteadyState proporciona una manera más eficaz de ayudar a los equipos compartidos a defenderse de los cambios realizados por usuarios que no son de confianza e instalaciones de software no deseadas. También puede ayudar a salvaguardar los recursos del sistema.
Novedades en Windows SteadyState
Windows SteadyState incluye numerosas características y funciones nuevas y mejoradas. Windows SteadyState no es sólo un nuevo diseño de Shared Computer Toolkit; hemos tenido en cuenta sus comentarios, los de nuestros clientes, para comprender mejor cómo podríamos proporcionar una solución que pudiera realmente ayudarle a administrar y mantener sus entornos de equipos compartidos.
Más sencillo de usar
- Más sencillo de configurar: se ha simplificado la instalación de Windows SteadyState para incluir el servicio Limpieza de secciones de perfil de usuario (UPHClean). Además, la característica Protección de disco de Windows mejorada de Windows SteadyState no requiere nuevas particiones.
- Más sencillo de usar
- La interfaz de usuario de Windows SteadyState se ha remodelado para facilitar la administración de las tareas comunes desde una única ubicación.
- La configuración de restricciones de usuario simplificada permite elegir un nivel de restricción alto, medio o bajo para cada cuenta de usuario.
- Windows SteadyState permite importar y exportar cuentas de usuario de un equipo a otro.
- Entre los resultados de los continuos esfuerzos por mejorar el servicio de soporte técnico, se incluyen un manual de Windows SteadyState completamente revisado (incluido en formato PDF y XPS), una Ayuda con contenido actualizado que se ofrece con la descarga, nuevas demostraciones en línea y el nuevo sitio web de la comunidad de Windows SteadyState.
- Protección mejorada para todos los usuarios: Windows SteadyState incluye más restricciones de características de programas y de Windows, así como soporte técnico para Windows Update. Windows SteadyState también permite restringir el acceso del usuario a los programas locales.
- Programa de Ventajas de Windows Original (WGA): la ejecución de una copia no original de Windows conlleva riesgos importantes. Sólo los clientes que usan copias originales de Windows se benefician de descargas de productos de Windows, actualizaciones de Windows que no estén relacionadas con la seguridad y ofertas especiales. Para poder instalar Windows SteadyState, la copia de Windows debe ser original. Para obtener más información, visite el sitio web del Programa de Ventajas de Windows Original.
Windows SteadyState incluye las siguientes características para ayudarle a administrar los equipos compartidos:
- Introducción: proporciona los pasos iniciales para empezar, así como la ayuda que necesita la primera vez que usa Windows SteadyState.
- Protección de disco de Windows: ayuda a proteger la partición de Windows, que contiene el sistema operativo Windows y otros programas, para que no se modifique sin la aprobación del administrador. Protección de disco de Windows ayuda a proteger el sistema operativo Windows y todos los archivos del equipo contra un cambio permanente. Los cambios realizados por usuarios compartidos cuando inician sesión en el equipo se eliminan al reiniciarlo. Windows SteadyState permite configurar Protección de disco de Windows para quitar todos los cambios tras el reinicio, para quitar los cambios en una fecha y hora determinadas o para no eliminar ningún cambio en absoluto.
- Restricciones del usuario y configuración: las opciones de configuración y las restricciones de usuario pueden ayudar a mejorar y simplificar la experiencia del usuario. Puede limitar el acceso del usuario a programas, valores de configuración, elementos del menú Inicio y opciones de Windows XP. También puede bloquear cuentas de usuario compartidas para evitar que los cambios se conserven entre una sesión y la siguiente.
- Administrador de cuentas de usuario: permite crear y eliminar cuentas de usuario. Puede usar Windows SteadyState para crear cuentas de usuario en unidades alternativas que conservarán la configuración y los datos de usuario incluso cuando la característica Protección de disco de Windows se encuentre activada. También puede importar y exportar la configuración de usuario de un equipo a otro, lo que permite ahorrar tiempo y recursos valiosos.
- Restricciones en el equipo: controla la configuración de seguridad, la configuración de privacidad y otras operaciones, como evitar que los usuarios creen y almacenen carpetas en la unidad C y que abran documentos de Microsoft Office desde Internet Explorer®.
Windows SteadeyState: Detalles de la Descarga
miércoles, 20 de junio de 2007
Activar/Desactivar la reproducción automática de los medios extraíbles (cd-rom, memoria usb, etc)
1. Inicio -> Ejecutar y teclear gpedit.msc. Aceptar.
2. Se abre el Editor de políticas del sistema
3. En la ventana Ventana Directiva de grupo ve a Configuración del equipo -> Plantillas administrativas -> Sisitema -> Desactivar reproducción automática.
4. Aparecerá una nueva pantalla llamada Propiedades de Desactivar reproducción automática. Marcar la opción Habilitar, colocar el valor Unidades de Cd-Rom en el menú desplegable, y finalmente Aplicar.
martes, 19 de junio de 2007
Problema al restaurar un backup en mysql relacionado con las claves ajenas
Para solucionar esto tenemos que desactivar la comprobación de las claves ajenas:
SET FOREIGN_KEY_CHECKS=0;
Y despues de restaurar la base de datos con éxito lo volvemos a activar:
SET FOREIGN_KEY_CHECKS=1;
Pero estas instrucciones hemos de realizarlas desde la linea de comandos de mysql.
Veamos un ejemplo de restauración de base de datos (suponiendo que ya tenemo la base de datos creada):
mysql> use nombre_bd
Database changed
mysql> set foreign_key_checks=0;
Query OK, 0 rows affected (0.00 sec)
mysql> source script_con_el_backup_de_la_bd.sql
(esto tardará un rato dependiendo del tamaño de la base de datos)
mysql> SET FOREIGN_KEY_CHECKS = 1;
Query OK, 0 rows affected (0.00 sec)
Y despues de esto ya tenemo la base de datos restaurada y activada la comprobación de las claves ajenas.
http://dev.mysql.com/doc/refman/5.0/es/innodb-foreign-key-constraints.html
miércoles, 13 de junio de 2007
Autenticación de windows dentro de Firefox
Pues bien, normalmente cuando accedemos mediante Internet Explorer a estas intranets se nos autentifica sobre la misma de forma automática con el usuario que hemos introducido al iniciar sesión en el equipo. Sin embargo, al acceder con Firefox no ocurre así, pues nos aparece una ventana de inicio de sesión en la que introducir de nuevo el mismo usuario que en inicio de sesión en el equipo.
Aquí vamos a ver como conseguir que Firefox utilice Autenticación Windows (Windows autentication) de la misma forma que lo hace firefox.
Para ello nos vamos a la carpeta:
C:\Archivos de programa\Mozilla Firefox\greprefs
y editamos el archivo all.js
Dentro de este archivo buscamos la clave :
network.automatic-ntlm-auth.trusted-uris
y le añadimos la url de nuestra intranet, quedando de esta manera:
pref("network.automatic-ntlm-auth.trusted-uris", "http://intranet");
Y ya podremos acceder a la intranet con nuestro usuario de Active Directory sin tener que iniciar sesión.
lunes, 4 de junio de 2007
Pegar sin formato en Ms Word
Como sabemos, para pegar sin formato tenemos que irnos al menú Edición>Pegado Especial y seleccionar "Sin formato".
Para poder realizar esta tarea más rápidamente (mediante atajos de teclado) vamos a crear una macro y luego asignarla a una combinación de teclas.
La macro contendrá la siguiente instrucción:
Selection.PasteSpecial DataType:=wdPasteText
Y luego solo hemos de asignarle la combinación de teclas que más nos guste.
Tenemos todo el proceso bien explicado en este enlace.
domingo, 3 de junio de 2007
Extensión de Firefox GDirections
Extensión GDirections
Extensión de Firefox Update Scanner
Update Scanner
sábado, 2 de junio de 2007
Crear cd / dvd autoejecutable (autorun)
1st AutoRun Express by Green Parrots Software
Es un programa de tipo asistente (wizard) que permite realizar esta tarea de forma fácil y sencilla
martes, 29 de mayo de 2007
NSSM Instalación de servicios en windows de forma fácil
http://iain.cx/src/nssm/
nLite para crear distribuciones de Windows personalizadas
lunes, 28 de mayo de 2007
Módulo para importar usuario desde un fichero de excel
martes, 22 de mayo de 2007
Manual libro sobre Drupal "Pro Drupal Development"
Drupal, one of the leading open source content management systems, is amazing. The more I learn about it the more impressed I am by the depth of thought (and amount of work) that’s gone into making it so powerful and flexible.
But, thanks to its complexity and to the large gaps and flaws in its documentation (poor documentation being a common problem with open source projects), Drupal can also be a huge time sink, frustration generator and spawner of traffic on the drupal.org forums. Now, though, comes relief: “Pro Drupal Development“, by John K. VanDyk and Matt Westgate, both of whom are key contributors to the Drupal project. If you’re thinking about doing anything beyond just installing Drupal and using its admin interface, get this book. It could quite likely save you weeks of trial and error.
lg3d-wonderland: Project Wonderland
lg3d-wonderland: Project Wonderland
Copiar marcadores en un documento pdf con Adobe Acrobat
- Inserta el documento que tenga los marcadores en el que se los quieras poner, te importará el árbol de marcadores. Pero los destinos tendrás que asignarlos de nuevo.
- Si quisieras mantener los destinos tendrías que tener dos documentos con las mismas páginas y reemplazar las del que ya tiene los marcadores con las del que no los tiene, guardas una copia, y tienes los marcadores y los destinos.
domingo, 20 de mayo de 2007
Herramientas para desarrollo de software distribuido geográficamente
ONLamp.com -- Tools for Geographically Distributed Software Development
jueves, 17 de mayo de 2007
Crear un objeto calendar con la fecha actual en java
Calendar.getInstance() devuelve un objeto GregorianCalendar cuyos campos and sido inicializados con la fecha y hora actual:
Calendar rightNow = Calendar.getInstance();
int julianDay = rightNow.get(Calendar.DAY_OF_YEAR);
int ccyy = rightNow.get(Calendar.YEAR);
int month = rightNow.get(Calendar.MONTH) + 1;
int day = rightNow.get(Calendar.DATE);
int hour12 = rightNow.get(Calendar.HOUR);
int hour24 = rightNow.get(Calendar.HOUR_OF_DAY);
int minute = rightNow.get(Calendar.MINUTE);
int second = rightNow.get(Calendar.SECOND);
int millisec = rightNow.get(Calendar.MILLISECOND);
// Create a copy of the rightNow Calendar object
Calendar baseCal = (Calendar)rightNow.clone();
// Subtract 5 days from the date
rightNow.add(Calendar.DATE, -5);
// Increments the date by one
rightNow.roll(Calendar.DATE, true);
// Decrements the date by one
rightNow.roll(Calendar.DATE, false);
// Returns true when rightNow is later than baseCal (false in this example)
boolean a = rightNow.after(baseCal);
// Returns true when rightNow is earlier than baseCal (true in this example)
boolean b = rigthNow.before(baseCal);
// Returns true when rightNow is equal to baseCal (false in this example)
boolean e = rightNow.equals(baseCal);
// Set the Calendar to a specific date (ccyy, month, day, hour, minute, second)
rightNow.set(1960, 7, 21, 10, 30, 30);
// Returns a Date object for the Calendar object
Date date = rightNow.getTime();
En el siguiente enlace puedes encontrar más informacions sobre la clase calendar:
domingo, 6 de mayo de 2007
Integración de pathauto con views
Advanced - Integration with Views
As you can see from the static text example, there is now a concept of directories in my blogs/greggles/my-blog-post alias. Pathauto provides an index alias feature but this is deprecated and will likely be removed in future versions. Instead you can use views to provide the same functionality. For example, if you create a view that has the page url "blogs" and that shows the teasers of all blog posts your site will now handle the www.example.com/blogs. If I then add an argument to that view for "Username: user is author" and select "Display all values" as the default I have created "index aliases" for my pathauto patterns. A site visitor who goes to www.example.com/blogs/greggles/ would now see a list of teasers that were created by greggles. You can take this example even further to support the [yyyy] pattern to filter to a specific time period.
Pathauto Pattern Recipes | drupal.org
lunes, 30 de abril de 2007
Conocer mi versión del Kernel
uname -r
Leer un String de un Blob
Leer un String de un Blob
Método para leer un String que por necesidades de tamaño se introduce en un blob. Al método se le pasa el resultSet y el nombre del campo en el que se encuentra el blob.
public String leerBlob(ResultSet rs,String blob){
String returndata="";
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
BufferedInputStream bis;
try {
bis = new BufferedInputStream(rs.getBinaryStream(blob));
byte[] bindata=new byte[1024];
int bytesread = 0;
try {
if ( !rs.wasNull() ) {
if ( (bytesread = bis.read(bindata,0,bindata.length)) != -1 ) {
baos.write(bindata,0,bytesread);
returndata= baos.toString();
}
bis.close();
}
} catch (IOException e) {
System.out.println("leerBlob -- Se produjo un error en la consulta");
System.out.println(e.getMessage());
}
} catch (SQLException ex) {
System.out.println("leerBlob -- Se produjo un error en la consulta");
System.out.println(ex.getMessage());
}
return returndata;
}
RecorteX - Recortes de código útiles.
lunes, 23 de abril de 2007
Struts: Action en el struts-config
http://struts.apache.org/1.x/userGuide/building_controller.html
4.7 The ActionMapping Implementation
In order to operate successfully, our controller servlet needs to know several things about how each request URI should be mapped to an appropriate Action class. The required knowledge has been encapsulated in a Java class named ActionMapping, the most important properties are as follows:
- type - Fully qualified Java class name of the Action implementation class used by this mapping.
- name - The name of the form bean defined in the config file that this action will use.
- path - The request URI path that is matched to select this mapping. See below for examples of how matching works and how to use wildcards to match multiple request URIs.
- unknown - Set to true if this action should be configured as the default for this application, to handle all requests not handled by another action. Only one action can be defined as a default within a single application.
- validate - Set to true if the validate method of the action associated with this mapping should be called.
- forward - The request URI path to which control is passed when this mapping is invoked. This is an alternative to declaring a type property.
4.8 Writing Action Mappings
How does the controller servlet learn about the mappings you want? It would be possible (but tedious) to write a small Java class that simply instantiated new ActionMapping instances, and called all of the appropriate setter methods. To make this process easier, the framework uses the Jakarta Commons Digester component to parse an XML-based description of the desired mappings and create the appropriate objects initialized to the appropriate default values. See the Jakarta Commons website for more information about the Digester.The developer's responsibility is to create an XML file named struts-config.xml and place it in the WEB-INF directory of your application. The format of this document is described by the Document Type Definition (DTD) maintained at http://struts.apache.org/dtds/struts-config_1_3.dtd. This chapter covers the configuration elements that you will typically write as part of developing your application. There are several other elements that can be placed in the struts-config file to customize your application. See Configuring Applications for more about the other elements in the framework's configuration file.
The controller uses an internal copy of this document to parse the configuration; an Internet connection is not required for operation.
The outermost XML element must be
This section contains your form bean definitions. Form beans are descriptors that are used to create ActionForm instances at runtime. You use a
- name: A unique identifier for this bean, which will be used to reference it in corresponding action mappings. Usually, this is also the name of the request or session attribute under which this form bean will be stored.
- type: The fully-qualified Java classname of the ActionForm subclass to use with this form bean.
This section contains your global forward definitions. Forwards are instances of the ActionForward class returned from an Action's execute method. These map logical names to specific resources (typically JSPs), allowing you to change the resource without changing references to it throughout your application. You use a
- name: The logical name for this forward. This is used in your Action's execute method to forward to the next appropriate resource. Example: homepage
- path: The context relative path to the resource. Example: /index.jsp or /index.do
- redirect: True or false (default). Should the ActionServlet redirect to the resource instead of forward?
This section contains your action definitions. You use an
- path: The application context-relative path to the action.
- type: The fully qualified java classname of your Action class.
- name: The name of your
element to use with this action
- parameter: A general-purpose attribute often used by "standard" Actions to pass a required property.
- roles: A comma-delimited list of the user security roles that can access this mapping.
4.8.1 ActionMapping Example
Here's a mapping entry based on the MailReader example application. The MailReader application now uses DynaActionForms. But in this example, we'll show a conventional ActionForm instead, to illustrate the usual workflow. Note that the entries for all the other actions are left out:
name="logonForm"
type="org.apache.struts.webapp.example.LogonForm" />
type="org.apache.struts.action.ActionForward">
name="logon"
path="/logon.jsp"
redirect="false" />
path="/logon"
type="org.apache.struts.webapp.example.LogonAction"
name="logonForm"
scope="request"
input="/logon.jsp"
unknown="false"
validate="true" />
First the form bean is defined. A basic bean of class "org.apache.struts.webapp.example.LogonForm" is mapped to the logical name "logonForm". This name is used as a request attribute name for the form bean.
The "global-forwards" section is used to create logical name mappings for commonly used presentation pages. Each of these forwards is available through a call to your action mapping instance, i.e. mapping.findForward("logicalName").
As you can see, this mapping matches the path /logon (actually, because the MailReader example application uses extension mapping, the request URI you specify in a JSP page would end in /logon.do). When a request that matches this path is received, an instance of the LogonAction class will be created (the first time only) and used. The controller servlet will look for a bean in request scope under key logonForm, creating and saving a bean of the specified class if needed.
Optional but very useful are the local "forward" elements. In the MailReader example application, many actions include a local "success" and/or "failure" forward as part of an action mapping.
path="/editSubscription"
type="org.apache.struts.webapp.example.EditSubscriptionAction"
name="subscriptionForm"
scope="request"
validate="false">
name="failure"
path="/mainMenu.jsp"/>
name="success"
path="/subscription.jsp"/>
Using just these two extra properties, the Action classes are almost totally independent of the actual names of the presentation pages. The pages can be renamed (for example) during a redesign, with negligible impact on the Action classes themselves. If the names of the "next" pages were hard coded into the Action classes, all of these classes would also need to be modified. Of course, you can define whatever local forward properties makes sense for your own application.
The configuration file includes several other elements that you can use to customize your application. See Configuring Applications for details.
4.9 Using ActionMappings for Pages
Fronting your pages with ActionMappings is essential when using modules, since doing so is the only way you involve the controller in the request -- and you want to! The controller puts the application configuration in the request, which makes available all of your module-specific configuration data (including which message resources you are using, request-processor, and so forth).
The simplest way to do this is to use the forward property of the ActionMapping:
4.10 Using Wildcards in ActionMappings
[Since Apache Struts 1.2.0] As an application grows in size, so will the number of action mappings. Wildcards can be used to combine similar mappings into one more generic mapping.
The best way to explain wildcards is to show an example and walk through how it works. This example modifies the previous mapping in the ActionMapping Example section to use wildcards to match all pages that start with /edit:
path="/edit*"
type="org.apache.struts.webapp.example.Edit{1}Action"
name="{1}Form"
scope="request"
validate="false">
name="failure"
path="/mainMenu.jsp"/>
name="success"
path="/{1}.jsp"/>
The "*" in the path attribute allows the mapping to match the request URIs /editSubscription, editRegistration, or any other URI that starts with /edit, however /editSubscription/add would not be matched. The part of the URI matched by the wildcard will then be substituted into various attributes of the action mapping and its action forwards replacing {1}. For the rest of the request, the framework will see the action mapping and its action forwards containing the new values.
Mappings are matched against the request in the order they appear in the framework's configuration file. If more than one pattern matches the last one wins, so less specific patterns must appear before more specific ones. However, if the request URL can be matched against a path without any wildcards in it, no wildcard matching is performed and order is not important.
Wildcard patterns can contain one or more of the following special tokens:
| * | Matches zero or more characters excluding the slash ('/') character. |
| ** | Matches zero or more characters including the slash ('/') character. |
| \character | The backslash character is used as an escape sequence. Thus \* matches the character asterisk ('*'), and \\ matches the character backslash ('\'). |
In the action mapping and action forwards, the wildcard-matched values can be accessed with the token {N} where N is a number from 1 to 9 indicating which wildcard-matched value to substitute. The whole request URI can be accessed with the {0} token.
The action mapping attributes that will accept wildcard-matched strings are:
- attribute
- catalog
- command
- forward
- include
- input
- multipartClass
- name
- parameter
- prefix
- roles
- suffix
- type
The action forward attributes that will accept wildcard-matched strings are:
- catalog
- command
- path
miércoles, 11 de abril de 2007
Loogic.com Tras el First Tuesday Madrid
Fantástico comienzo para el primer First Tuesday en Madrid de la era post burbuja.
Expectación creo que es la palabra que mejor define lo que he podido ver hoy en Negone. No lo he contado pero debíamos ser entorno a los 100 emprendedores, empresarios e inversores los que nos hemos reunido para hacer networking y escuchar las interesantes experiencias de Rodolfo Carpintier (Inversor), Roberto Saint-Malo (Inversor) y Gustavo García (Emprendedor).
Digo expectación porque todos esperábamos la respuesta a la pregunta del millón: Hay inversión en negocios 100% Internet? Y aunque no se ha podido responder a esta pregunta con claridad lo cierto es que el movimiento está, que los inversores están interesados por entrar en proyectos de Internet y que emprendedores hay suficientes como para satisfacer esas necesidades de inversión.
Me ha llamado especialmente la atención en el First Tuesday Madrid la presencia internacional, no he profundizado mucho en ello pero tengo la sensación de que empresarios y emprendedores europeos están eligiendo España como base para lanzar sus proyectos a nivel internacional.
También quiero destacar las intervenciones de Rodolfo Carpintier que para mi han sido especialmente interesantes. Se dice que Rodolfo fue la primera persona en España en usar el email (cuando yo acababa de nacer) no se si esto estará contrastado pero lo cierto es que Rodolfo es de las personas que mejor conoce Internet en España y eso se nota con claridad cuando habla.
Y tras el encuentro de Networking he tenido la suerte de asistir a la cena de negocios junto con otras 20 personas de muy distintos perfiles pero con la pasión por los negocios como común denominador.
Me hubiera gustado tomar notas durante la cena porque se ha hablado de temas realmente interesantes, se han dado cifras de inversión y de negocio (ya sabeis lo que me gustan las cifras) y se ha hablado de los nuevos proyectos de todos los que estábamos allí reunidos.
Para terminar mencionar una propuesta que ha surgido de la cena, comenzar una campaña viral para fomentar el ahorro energético y así ayudar en lo posible a luchar contra el cambio climático. Sobre esto comentaré mañana más en un post específico.
Actualización: Carlos Blanco y Ángel María también lo comentan.
Loogic.com Tras el First Tuesday Madrid
Twitter and Jott Vulnerable to SMS and Caller ID Spoofing
Both Twitter and Jott authenticate users by their phone number. Twitter does this by validating users based upon the source of SMS messages sent to the phone number 40404 (US), and Jott does this by trusting the incoming Caller ID when someone calls 877-568-848. From a security perspective this means the following:
- Anyone who knows your phone number can update your Twitter page by spoofing a SMS message, i.e. post a Twitter entry as you.
- Anyone who knows your phone number can spoof his or her caller ID to send a Jott message as you.
Twitter and Jott Vulnerable to SMS and Caller ID Spoofing
Módulo UML para Netbeans 5.5
Este módulo permite crear los siguientes diagrams UML:
de Actividad, de Clases, de Colaboración, de Componentes, de Despliegue, de Secuencia, de Estado y de Casos de Uso. Además permite generar código a partir de los diagramas y viceversa, así como mantener la sincronización entre los diagramas y el código. Incluso tiene predefinidos un conjunto de 23 patrones de diseño para implementar en tus diagramas.
Puedes ver capturas de pantalla en este sitio y puedes obtenerlo desde la opción de Actualizar de Netbeans.
http://www.netbeans.org/products/uml/index.html
javaHispano. Tu lenguaje, tu comunidad. (Cañamo v0.8-dev)
Comunicaciones y ocio en una casa domótica | CONSUMER.es EROSKI
Comunicaciones y ocio en una casa domótica | CONSUMER.es EROSKI
Twitter: llega el 'microblogging' [Pag. 1 de 2] | CONSUMER.es EROSKI
Twitter: llega el 'microblogging' [Pag. 1 de 2] | CONSUMER.es EROSKI
domingo, 1 de abril de 2007
Oxado, publicidad para tu sitio web
¿Por qué escoger Oxado?
- Porque es completamente Gratuito
- Porque puede darle una fuerte remuneración gracias a las asociaciones exclusivas con los más importantes controles "COST PER clic" del mundo: Overture, Espotting, FindWhat, Mirago, etc.
- Su sitio web no estará obligado a realizar un tráfico mínimo para inscribirse
- Pagos mensuales
- Fácil integración en todo el medio ambiente web.
- Variados formatos publicitarios para una mejor adaptación a su sitio
- Más de 2 millones de anuncios que cubren España, Italia, Francia, Inglaterra, Alemania, Holanda, Australia y los Estados Unidos y el Canáda
- Una selección automática de los anuncios
- Una difusión inmediata de los anuncios en su sitio web
- La disponibilidad de estadísticas detalladas
- La alternancia de la publicidad
- La calidad de los editores
- La diversidad de los temas de anuncios, desde grandes bancos hasta empresas locales.
- El acceso a redes de millares de editores
Oxado
miércoles, 28 de marzo de 2007
Workrave: administrar las horas frente al ordenador | CONSUMER.es EROSKI
Workrave: administrar las horas frente al ordenador
Se trata de una aplicación que obliga a descansar del ordenador durante un tiempo determinado
Workrave es un programa que racionaliza las sesiones de trabajo frente al ordenador, una aplicación muy útil para todos aquellos que tienen que permanecer ocho horas al día frente a una pantalla. Actúa de recordatorio constante y con sus avisos ayuda a prevenir la fatiga visual que causa mirar con fijeza el monitor durante demasiado tiempo, o los problemas en la espalda o en la muñeca generados por vicios posturales o por movimientos repetitivos.
Workrave: administrar las horas frente al ordenador | CONSUMER.es EROSKI
Parse a String to obtain a Date/GregorianCalendar object - Real's Java How-to
import java.text.*;
import java.util.*;
public class dformat {
public static void main (String a[]){
try {
/*
** we specify Locale.US since months are in english
** we want to parse a TimeStamp
*/
SimpleDateFormat sdf = new SimpleDateFormat
("dd-MMM-yyyy HH:mm:ss", Locale.US);
/*
** fix timezone in the SimpleDateFormat
** bug in JDK1.1
*/
sdf.setCalendar(Calendar.getInstance());
/*
** create a Date (no choice, parse returns a Date object)
*/
Date d = sdf.parse("24-Feb-1998 17:39:35");
System.out.println(d.toString());
/*
** create a GregorianCalendar from a Date object
*/
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(d);
System.out.println(gc.getTime().toString());
}
catch (Exception e) {
e.printStackTrace();
}
}
}
Parse a String to obtain a Date/GregorianCalendar object - Real's Java How-to
domingo, 25 de marzo de 2007
OpenID Phishing: Guía para principiantes | Kriptópolis
OpenID Phishing: Guía para principiantes | Kriptópolis
sábado, 24 de marzo de 2007
PHP RPMs: PHP: The missing RPMs
PHPRPMs is a collection of RPM packages that add various PHP extensions to the PHP that you have as a part of your RPM-based Linux Distribution (Red Hat Enterprise Linux, CentOS, WhiteBox or Fedora Core). The advantages of this approach are:
- you don't have to rebuild PHP from the source if you just need one of the less-frequently used or non-GPL extensions;
- since you don't rebuild PHP, you get to keep your "factory" PHP packages with all distro-specific patches and, what's more important,
- you can continue to receive the standard updates for the "factory" PHP packages via RHN / up2date / yum
PHP RPMs: PHP: The missing RPMs
viernes, 23 de marzo de 2007
Obtener pleno soporte multimedia con Fedora Core 6 | Fedora-es
Voy a explicar como obtener soporte para poder ver todo tipo de peliculas y escuchar todo tipo de audio con Fedora Core 6 y el software que te viene con gnome por defecto, es decir Rhythmbox y Totem
Vamos a la terminal y entramos como root:
$ su -
Instalamos los repositorios de Livna:
# rpm -ivh http://rpm.livna.org/livna-release-6.rpm
Instalamos los plugins para escuchar mp3:
# yum install gstreamer-plugins-ugly
Borramos el totem que viene:
# yum remove totem totem-mozplugin
Instalamos el totem-xine y las dependencias y el plugin para firefox si queremos:
# yum install totem-xine totem-xine-mozplugin
Instalamos los siguientes paquetes, aunque quizás ya los tengais:
# yum install ffmpeg gstreamer-ffmpeg sox lame faad2 mjpegtools xine-lib-extras-nonfree
si no me he saltado nada ya deberiais tener soporte para todo tipo de videos y mp3 con totem y rhythmbox.
Si teniais alguno de los paquetes instalados desde otros repositorios, borradlos e instaladlos desde livna, o bien instaladlos desde ese repositorio si estan, pero no mezcleis livna con otro repositorio porque son incompatibles y podrian no funcionar.
Obtener pleno soporte multimedia con Fedora Core 6 | Fedora-es
Struts, forward con parámetros
En la deficinición del forward, dentros del struts-config.xml, no se podían indicar parámetros.
El problema se complicaba cuando estos parámetros son dinámicos (que es la mayoría de los casos).
Solución.
A partir de la versión 1.2.7 parece que se ha arregado el problema.Existe una clase nueva que herada del ActionForward.
Se trata de ActionRedirect.
En el javadoc se puede ver cómo funciona, pero baśicamente:
- Declaramos el forward en el struts-config.xml, sin parámetros.
- En la implementación de nuestro Action, obtenemos el ActionForward que hemos declarado anteriormente.
ForwardConfig forwardConfig = mapping.findForward("elForward"); - A partir del ActionForward anterior, creamos el ActionRedirect, pasándole los parámetros que necesitemos.
ActionRedirect redirect = new ActionRedirect(forwardConfig);
redirect.addParameter("param1","value1");
redirect.addParameter("param2","2");
redirect.addParameter("param3","3.0");
return redirect;
Angel Cervera
jueves, 22 de marzo de 2007
Could not include font definition file | drupal.org
I get this error when trying to download a page as PDF. I installed the module according to the instructions and searched Google for support on this error but didn't come up with anything. I ensured that K_PATH_MAIN and K_PATH_URL are set correctly. Does anyone have advice?
It sounds like the folder tcpdf isn't installed in the correct place. You need to put it under your modules/pdfview folder. Then reset the K_PATH_MAIN and K_PATH_URL. The would most likely look something like this:
K_PATH_MAIN = /home/username/public_html/modules/pdfview/tcpdf/ (the first bit depends on your host)
K_PATH_URL = http://www.yourdomain.com/modules/pdfview/tcpdf/
Could not include font definition file | drupal.org
activar mod_rewrite - Foros del Web
En primer lugar dentro del httpd.conf debemos buscar la línea donde está nombrado el módulo mod_rewrite.so y quitarle el # que tiene delante para activarlo.
#LoadModule rewrite_module modules/mod_rewrite.so
Con eso ya tendremos el módulo activo, pero Apache no podrá leer aún los .htaccess, así que para que lea los .htaccess debemos buscar lo siguiente:
Options FollowSymLinks
AllowOverride none
Order deny,allow
Deny from all
Satisfy all
Y dejarlo como sigue:
Options FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
Satisfy all
Tras reiniciar el servidor Apache ya debería tomarnos las reglas indicadas en el .htaccess
activar mod_rewrite - Foros del Web
Servidores virtuales en Apache
El dominio principal o por defecto
En páginas anteriores hemos visto que Apache crea al instalarse la carpeta conf (ruta completa C:\Archivos de programa\Apache Group\Apache\conf), dentro de la cual están los archivos de configuración del servidor, archivos que tendremos que modificar para adecuar a nuestro sistema.
El archivo que nos interesa es httpd.conf.
Por defecto Apache se instala para servir un solo dominio. Estas son algunas de las directivas que debes comprobar en http.conf:
- ServerRoot "C:/Archivos de programa/Apache Group/Apache2" (o .../Apache si usas la version 1.2). Es la carpeta de instalación del server. Sin barra final.
- Listen 80 El puerto donde Apache 'escucha'. El puerto 80 es el puerto http por defecto. No lo cambies si no tienes una buena razón para ello.
- DocumentRoot "C:/Archivos de programa/Apache Group/Apache2/htdocs": la carpeta pública del server. Ahi van los archivos de tu página. Por ejemplo si mueves a htdocs tu página de inicio "index.html", podrás verla tecleando en el navegador localhost/index.html. Verás que esa carpeta está llena de archivos. Puedes borrarlos: son la página de bienvenida que trae Apache y sirven solamente para informarte de que la instalación ha funcionado.
Esta directiva establece las reglas que se aplican para servir los documentos almacenados en htdocs. Como en html, es un contenedor. La etiqueta de cierre es
Lo básico a retener de lo anterior es que las páginas que guardes en DocumentRoot (carpeta htdocs) se verán cuando te conectes con ServerName (localhost o el dominio que hayas especificado).
Pero ¿que ocurre si deseas tener varios dominios separados? por ejemplo www.micasa.com y www.mioficina.com ? Si todas las páginas están en la misma carpeta, como sabe Apache que pagina servir bajo que dominio ?
Asumiendo que tengas resuelto el tema de las DNS, es decir, que esos dominios se resuelvan hacia tu IP, puedes utilizar servidores virtuales.
Servidores virtuales con apache
Nada mas fácil que crear servidores virtuales con apache. Vamos a suponer que por ejemplo, has acudido a un servicio como www.dyndns.org y tienes dos subdominios como pepe.dyndns.org y pepita.dyndns.org, ambos apuntando a tu IP. Bien, lo primero que debes considerar es que si creas un solo dominio virtual, la configuración del server por defecto, o dominio principal de la que hablamos hasta ahora no funcionará. Por ello la solución no es tener el dominio por defecto y ademas un server virtual, sino dos servidores virtuales, de los cuales el primero (por orden de aparición) se considerará server por defecto.
Bien, hay dos formas de identificar servidores virtuales en apache. Una es por IP y otra por nombres de dominio. El método mas sencillo y normal es el segundo, y aqui solo nos referiremos a él.
Navega al final de tu archivo http.conf y descomenta esta directiva:
A continuación escribe una sección como esta:
ServerAdmin micorreo@midireccion.com
ServerName pepe.dyndns.org
DocumentRoot "C:/Archivos de programa/Apache Group/Apache2/htdocs"
Fijate que al abrir la sección escribimos '*:80', exactamente lo mismo que en NameVirtualHost. Esto es importante.
Fíjate también que este es nuestro dominio principal, que es el que tenemos almacenado en htdocs. Vamos ahora al segundo dominio, creamos otra sección parecida:
ServerAdmin mi_otro_correo@mi_otra_direccion.com
ServerName pepita.dyndns.org
DocumentRoot "C:/mis documentos/documentos de pepita"
Suficiente !. Si escribes en tu navegador pepe.dyndns.org veras la pagina guardada en htdocs, y si escribes pepita.dyndns.org verás la página guardada en el DocumentRoot de ese otro server.
Ten en cuenta simplemente que dentro de cada directiva de servidor virtual puedes poner las reglas de visualización que desees, exactamente como lo harías para el dominio por defecto (indexes, indexoptions, etc).
Apuntes sobre servidores: Servidores virtuales
martes, 20 de marzo de 2007
Fallo en office/word que provoca el cierre inesperado de la aplicación
Microsoft Word for Windows ha detectado un problema y debe cerrarse.
En los datos que contiene el informe de errores leo los siguiente:
AppName: winword.exe AppVer: 9.0.0.2823 ModName: hpzpm310.dll
ModVer: 2.323.0.0 Offset: 00041983

Cuando cerramos esta ventan simplemente word se cierra de golpe, no dejandote trabajar ni nada.Pues bien, el problema viene relacionado con hpzpm310.dll que es una dll que se me ha instalado con los drivers de mi impresora HP 3740 (instalada en red en otra maquina).
La solución más rápida que he encontrado es borrar la impresora en cuestión (esto me impide imprimir claro) lo que ya me permite trabajar con Word.
HELP FILE
viernes, 16 de marzo de 2007
Acceder a los datos de un action form de struts
JoinForm joinForm = (JoinForm) form;
String email = joinForm.getEmail();
Struts, an open-source MVC implementation
Common Struts Errors
Common Struts Errors
Common Struts Errors and Causes
This page contains errors and exceptions commonly encountered during web application development using Struts. Along with the exception or error messages themselves, potential causes of these errors are often listed along with links to additional resources.
To find the error you're looking for, use your browser's Find or Search capability and input a few words that you are seeing in your error message.
| Cannot retrieve mapping for action | |
|---|---|
| Exception | javax.servlet.jsp.JspException: Cannot retrieve mapping for action /Login |
| Probable Cause | No action defined in struts-config.xml to match that specified in the JSP's . |
| Related Links | |
| Cannot retrieve definition for form bean null | |
|---|---|
| Exception | org.apache.jasper.JasperException: Cannot retrieve definition for form bean null |
| Probable Cause | This exception typically occurs because Struts cannot find the form bean it expects for a specific action according to the mapping in the struts-config.xml file. Most often, this is probably because the name given to the form in the name attribute of the form-bean element does not match the name attribute of the associated action's action element. In other words, the action and form should each have a name attribute that matches exactly, including case. It has been reported that this error has been seen when no name attribute is associated with the action. If there is no name attribute in an action element, no form is associated with the action. Others have reported this error as merely a symptom of something completely unrelated (all too common), but the mismatch of name attributes in the form-bean and action elements in the struts-config.xml file is the usual culprit. |
| No action instance for path /xxxx could be created | |
|---|---|
| Exception | No action instance for path /xxxx could be created |
| Probable Causes | Special Note: Because so many different things can cause this error, it is recommended that you turn your error logging/debugging levels on your web server to a high level of verbosity to see the underlying problems in trying to instantiate the action class you have written and associated with the specified action xxxx through an action mapping in the struts-config.xml file. |
Your Action class specified in the struts-config.xml file under the class attribute of the action mapping for action xxxx cannot be found for a variety of reasons, including (but not limited to):
| |
Action class specified in the /xxxx action mapping in the struts-config.xml file (class attribute) does not extend (directly or indirectly) from the Action class. In other words, your custom Action class does not extend off the Struts-provided Action class or off of another class that eventually extends the Action class (such as DispatchAction. | |
Problem in your classpath, such as web server not being able to find ApplicationResources.properties files in the WEB-INF/classes/ directory or specified subdirectory. | |
Problem in struts-config.xml file with action mapping. | |
Problem with data-sources.xml file. | |
| Relevant Links |
|
| No getter method for property XXXX of bean org.apache.struts.taglib.html.BEAN | |
|---|---|
| Exception | javax.servlet.jsp.JspException: No getter method for property username of bean org.apache.struts.taglib.html.BEAN |
| Probable Causes | No getXXXX() method defined for form field with name XXXX |
This can happen if the JSP/Struts developer forgets that the name of the get method will have the same spelling as the value supplied in the Struts tag's property attribute, but that case will be different and is based on JavaBean specification rules. For example, my form class should have a getUsername method if my Struts form-related tag has username as the value for its property attribute. Note the difference in case marked with emphasis on the letter "U." | |
| Related Links |
|
| java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm | |
|---|---|
| Error | java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm |
| Probable Causes | This error occurs typically when the specified Java .class file cannot be located in the classpath. If this occurs at runtime of a web application (error shows on browser rather than a rendered page), this typically means that specified class is not in the web server's classpath (made up primarily of /WEB-INF/classes and /WEB-INF/lib contents). Note that the NoClassDefFoundError in general typically indicates lack of the specified class in the relevant classpath. In this particular case the missing class would be ActionForm.class |
This error is sometimes seen when one or more ActionForm.class instances are actually in the classpath. This most often occurs when ActionForm.class is made available correctly by placing struts.jar in the /WEB-INF/lib directory. When this library has been correctly placed and it is verified that ActionForm.class actually is present in the struts.jar file, the problem is either that more than one copy of ActionForm.class is in the classpath or (more likely) that duplicate versions of class files other than ActionForm are in the same classpath, causing confusion. This is especially true if a class that extends ActionForm is made available twice, such as in an .ear file that encompasses a .war file as well as in the .war file's own classpath (/WEB-INF/classes). This problem can be resolved by guaranteeing that there are no redundant classes, especially those related to Struts (directly from Struts or extensions of Struts), in the web application's view. | |
| Related Links |
|
| Exception creating bean of class org.apache.struts.action.ActionForm: {1} | |
|---|---|
| Exception | javax.servlet.jsp.JspException: Exception creating bean of class org.apache.struts.action.ActionForm: {1} |
| Probable Causes | Instantiating Struts-provided ActionForm class directly instead of instantiating a class derived off ActionForm. This might occur implicitly if you specify that a form-bean is this Struts ActionForm class rather than specifying a child of this class for the form-bean. |
Not associating an ActionForm-descended class with an action can also lead to this error. | |
| Related Links | |
| Cannot find ActionMappings or ActionFormBeans collection | |
|---|---|
| Exception | javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection |
| Probable Causes | Either the .do extension mapping or both not present in the web.xml file. I saw a case where the web.xml file had no elements other than the root element and so this error was occurring. |
Typos or spelling errors in the struts-config.xml can lead to this error message. For example, missing a slash ("/") on a closing tag can have this effect. | |
Another element that must be present in the web.xml file is the load-on-startup element. This can be either an empty tag or can have an integer specified that indicates the priority of executing the associated servlet. The higher the number in the load-on-startup tags, the lower its priority. | |
Another possibility, related to need to use load-on-startup tag, is that precompiling JSPs using Struts can lead to this message as well. | |
| Related Links | |
| NullPointerException at ... RequestUtils.forwardURL | |
|---|---|
| Exception | java.lang.NullPointerException at org.apache.struts.util.RequestUtils.forwardURL(RequestUtils.java:1223) |
| Probable Causes | Missing path attribute in the forward subelement of the action element in struts-config.xml |
| Related Links | |
| Cannot find bean org.apache.struts.taglib.html.BEAN in any scope | |
|---|---|
| Exception | javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope |
| Probable Causes | Trying to use Struts Note that if you accidentaly make your opening Note your prefix may be different than
|
| Related Links |
|
| Missing message for key xx.xx.xx | |
|---|---|
| Exception | javax.servlet.jsp.JspException: Missing message for key xx.xx.xx |
| Probable Causes | The key-value pair with specified key is not in ApplicationResources.properties file |
ApplicationResources.properties file not in classpath (not in WEB-INF/classes directory in specified location) | |
| Related Links | |
| Cannot find message resources under key org.apache.struts.action.MESSAGE | |
|---|---|
| Exception | Cannot find message resources under key org.apache.struts.action.MESSAGE |
| Probable Causes | Explicitly trying to use message resources that are not available (such as ApplicationResources.properties not available |
Implicitly trying to use message resources that are not available (such as using empty html:options tag instead of specifying the options in its body -- this assumes options are specified in ApplicationResources.properties file) | |
| XML parser issues -- too many, too few, incorrect/incompatible versions | |
| Related Links |
|
| No input attribute for mapping path /loginAction | |
|---|---|
| Error | No input attribute for mapping path /xxxxAction |
| Probable Cause | No input attribute in action mapping in struts-config.xml file for the action with the name specified in the error message. An input attribute is not required if form validation is not performed (either because the validate attribute is set to false or because the validation method in the relevant form class is not implemented. The input attribute specifies the page leading to this action because that page is used to display error messages from the form validation. |
| Related Links | |
| Strange Output Characters | |
|---|---|
| Error | Strange and seemingly random characters in HTML and on screen, but not in original JSP or servlet. |
| Probable Causes | Regular HTML form tags intermixed incorrectly with Struts html:form tags. |
| Encoding style used does not support characters used in page. | |
| Related Links | |
| "Document contained no data" or no data rendered on page | ||
|---|---|---|
| Error | "Document contained no data" in Netscape | |
| No data rendered (completely empty) page in Microsoft Internet Explorer | ||
| Probable Cause | Employing a descendent of the Action class that does not implement the perform() method while using the Struts 1.0 libraries. Struts 1.1 Action child classes started using execute() rather than perform(), but is backwards compatible and supports the perform() method. However, if you write an Action-descended class for Struts 1.1 with an execute() method and try to run it in Struts 1.0, you will get this "Document contained no data" error message in Netscape or a completely empty (no HTML whatsoever) page rendered in Microsoft Internet Explorer. | |
| Related Links | ||