elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Tutorial básico de Quickjs


  Mostrar Mensajes
Páginas: [1] 2 3 4 5 6
1  Programación / Java / Re: JSP + FORM + JAVA BEANS + SERVLETS = ¿Duda? en: 28 Febrero 2010, 00:49 am
no hagas triple post
perdon pero estoy agldo desesperado
2  Programación / Java / JSP + FORM + JAVA BEANS + SERVLETS = ¿Duda? en: 27 Febrero 2010, 06:20 am
Hola que tal estoy un poco desesperado ya busue ejemplos en internet pero no me salen y no c por que mi problema es que no puedo hacer que un formulario que esta dentro de un JSP mande los datos a un java bean y que estos datos de muestren en un Servlet espero y me puedan ayudar conn un ejemplo muy facil muchas gracias
3  Programación / Java / Duda com <jsp:bean--- en: 26 Febrero 2010, 07:07 am
hola que tal estoy intentando usar el Lenguaje de Expresiones de JSP pero no me manda los valores de un form a un bean no c por que aqui esta mi codigo espero y me puedan ayudar, esto funciona así inicio con el formulario 
Código:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <jsp:useBean id="mensa" scope="session" class="javabeans.mensajes">
    <jsp:setProperty name="mensa" property="*"/>
    </jsp:useBean>

    <body>
    <h1>JSP Page</h1>
    <h1>Registro de Usuario</h1>
    <form name="mensa" action="Mostrar" method="POST">
   
        <table>
            <tr>
                <td>Nombre:</td>
                <td><input type="text" name="nombre" value="" /></td>
            </tr
            <tr>
                <td>Apellidos:</td>
                <td><input type="text" name="apellidos" value=""</td>
            </tr>
            <tr>
                <td>Usuario:</td>
                <td><input type="text" name="usuario" value=""</td>
            </tr>
            <tr>
                <td>Password:</td>
                <td><input type="password" name="password" value=""</td>
            </tr>
            <tr>
                <td>Email:</td>
                <td><input type="text" name="email" value=""</td>
            </tr>
        </table>
       <input type="submit" value="Registrar" />
                &nbsp;&nbsp;
                <input type="reset" value="Limpiar" />
 </form>
    </body>
</html>

y en el formulario le mando los datos al packete javabeans y a la clase mensajes

Código:
package javabeans;



/**
 *
 * @author Eroscracker
 */
public class mensajes {

  private String nombre;
  private String apellidos;
  private String usuario;
  private String password;
  private String passwordrep;
  private String email;

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getApellidos() {
        return apellidos;
    }

    public void setApellidos(String apellidos) {
        this.apellidos = apellidos;
    }

    public String getUsuario() {
        return usuario;
    }

    public void setUsuario(String usuario) {
        this.usuario = usuario;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPasswordrep() {
        return passwordrep;
    }

    public void setPasswordrep(String passwordrep) {
        this.passwordrep = passwordrep;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

  }
 



y despues los datos los muestro en el servlet pero estos no los muestra sale null

Código:
package servlets;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javabeans.*;

/**
 *
 * @author Eroscracker
 */
public class Mostrar extends HttpServlet {
   

    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        mensajes m = new mensajes();
        try {
     

            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet Mostrar</title>"); 
            out.println("</head>");
            out.println("<body>");
            out.println("<h1>Servlet Mostrar at " + request.getContextPath () + "</h1>");



            out.println("Nombre:"+ m.getNombre()+"<br>");
            out.println("Apellidos:"+ m.getApellidos()+"<br>");
            out.println("Usuario:"+m.getUsuario()+"<br>");
            out.println("Password:"+m.getPassword()+"<br>");
            out.println("Email:"+m.getEmail()+"<br>");
            out.println("</body>");
            out.println("</html>");
           
        } finally {
            out.close();
        }
    }

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /**
     * Handles the HTTP <code>GET</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Handles the HTTP <code>POST</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Returns a short description of the servlet.
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>

}
4  Programación / Java / Hola una duda con Struts en: 26 Febrero 2010, 04:37 am
Hola no se si este tema va a qui o en desarrollo web :-\  espero y me puedan ayudar estoy aprendiendo struts  usando java beans pero no c como hacer para ver los datos de que guarde espero y me puedan ayudar aqui les dejo el codigo gracias

index.jsp
Código:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<jsp:forward page="Form.do"/>


RegistroForm.java
Código:
package javabeans;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.*;

public class RegistroForm extends ActionForm {

    private String nombre;
    private String apellidos;
    private String usuario;
    private String password;
    private String email;

    //metodos de acceso
    public String getNombre() {
        return nombre;
    }//Fin del getnombre

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }//Fin del setNombre

    public String getApellidos() {
        return apellidos;
    }//Fin del getAmeppidos

    public void setApellidos(String apellidos) {
        this.apellidos = apellidos;
    }//Fin del setApellidos

    public String getUsuario() {
        return usuario;
    }//Fin del getUsuario

    public void setUsuario(String usuario) {
        this.usuario = usuario;
    }//Fin del setUsuario

    public String getPassword() {
        return password;
    }//Fin del getPassword

    public void setPassword(String password) {
        this.password = password;
    }//Fin del setPassword

    public String getEmail() {
        return email;
    }//Fin del getEmail

    public void setEmail(String email) {
        this.email = email;
    }//Fin setEmail
}//Fin del la clase


Formulario.jsp

Código:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html:html>
    <body>
        <center>
    <h1>Registro de Usuario</h1>
    <html:form action="/registrar" method="POST">
        <table>
            <tr>
                <td>Nombre:</td>
                <td><html:text property="nombre"/></td>
            </tr
            <tr>
                <td>Apellidos:</td>
                <td><html:text property="apellidos"/></td>
            </tr>
            <tr>
                <td>Usuario:</td>
                <td><html:text property="usuario"/></td>
            </tr>
            <tr>
                <td>Password:</td>
                <td><html:password property="password"/></td>
            </tr>
            <tr>
                <td>Email:</td>
                <td><html:text property="email"/></td>
            </tr>
        </table>
                <html:submit property="submit" value="Registrar"/>
                &nbsp;&nbsp;
                <html:reset value="Limpiar"/>
    </html:form>
        </center>
    </body>
</html:html>

struts-config.xml

Código:
<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_3.dtd">


<struts-config>
    <form-beans>
     <form-bean name="RegistroForm" type="javabeans.RegistroForm"/>
    </form-beans>
    
    <global-exceptions>
    
    </global-exceptions>

    <global-forwards>
        <forward name="form"  path="/Form.do"/>
    </global-forwards>

    <action-mappings>
        <action path="/Form" forward="/Formulario.jsp"/>
        
        
    </action-mappings>
    
    <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>

    <message-resources parameter="com/myapp/struts/ApplicationResource"/>    
    
    <!-- ========================= Tiles plugin ===============================-->
    <!--
    This plugin initialize Tiles definition factory. This later can takes some
    parameters explained here after. The plugin first read parameters from
    web.xml, thenoverload them with parameters defined here. All parameters
    are optional.
    The plugin should be declared in each struts-config file.
    - definitions-config: (optional)
    Specify configuration file names. There can be several comma
    separated file names (default: ?? )
    - moduleAware: (optional - struts1.1)
    Specify if the Tiles definition factory is module aware. If true
    (default), there will be one factory for each Struts module.
    If false, there will be one common factory for all module. In this
    later case, it is still needed to declare one plugin per module.
    The factory will be initialized with parameters found in the first
    initialized plugin (generally the one associated with the default
    module).
    true : One factory per module. (default)
    false : one single shared factory for all modules
    - definitions-parser-validate: (optional)
    Specify if xml parser should validate the Tiles configuration file.
    true : validate. DTD should be specified in file header (default)
    false : no validation

    Paths found in Tiles definitions are relative to the main context.
    -->
    <plug-in className="org.apache.struts.tiles.TilesPlugin" >
        <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />      
        <set-property property="moduleAware" value="true" />
    </plug-in>
    
    <!-- ========================= Validator plugin ================================= -->
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
        <set-property
            property="pathnames"
            value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
    </plug-in>
  
</struts-config>
5  Programación / Java / Duda en una creacion de una instancia en: 14 Febrero 2010, 22:39 pm
Hola que tal espero y me puedan ayudar compre un libro de java para aprender y en un ejemplo se crea una instancia  "Mensaje men=(Mensaje)request.getAttribute("mensa");"
mi duda es por que (Mensaje) esta entre parentesis y por que no es igual a las otras instancias como
Mensaje men = new Mensaje();
en que cambia ese detalle que comente muchas gracias por su ayuda
6  Seguridad Informática / Materiales y equipos / Re: Ayuda para comprar tarjeta wireless USB en: 28 Mayo 2009, 03:48 am
amm teng esa duda tambien.


muchachos del staff  ajaja   que dicen de  la alfaa   conviene pillarsela

http://www.comprawifi.com/usb/alta-potencia/alfa-usb-500mw-antena-desmontable-realtek-8187l/prod_1898.html

 inyecta bien y too el royo??? :D


pues yo con esta tarjeta usando el wifislax 3.1 me ha funcionado muy bien puedo asociarme he inyectar paquetes, casi siempre me tardo como 5 minutos almenos que el router me quede lejos yo la recomiendo al 100% y si lo que quieres es aumentar la distancia puedes hacer el molde de una antena la forras de papel aluminio y en medio tu usb y la conectas con una extensión a tu pc comosi fuera una antena y con eso aumenta la señal
7  Seguridad Informática / Materiales y equipos / Re: Ayuda para comprar tarjeta wireless USB en: 27 Mayo 2009, 21:54 pm
mira yo tengo una y me funciona muy bien no tiene ningun problema en modo monitor y ni de  otro tipo ,  tiene muy  buena señal es una linksys modelo wusb54gc





8  Seguridad Informática / Desafíos - Wargames / Re: Eres un Hacker? PRUEBALO CON ESTE TEST!!!!!! en: 8 Abril 2009, 20:44 pm
jajajj acabo de pasar la 7  :xD

oye cual es la tecnica para pasar jeje
9  Seguridad Informática / Desafíos - Wargames / Re: Eres un Hacker? PRUEBALO CON ESTE TEST!!!!!! en: 30 Marzo 2009, 23:03 pm
hola que tal deplano no puedo pasar el 7 ya se que esta en el codigo fuente el error pero me podrian dar otra ayuda porfas
10  Programación / Java / procesos en: 25 Marzo 2009, 22:40 pm
hola que tal algna persona sabe si se pueden matar procesos de windows con java y si si, me podrian pasar un link gracias
Páginas: [1] 2 3 4 5 6
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines