Coneccion Basica JSP - Servlet

martind_125
21 de Noviembre del 2008
Estoy iniciandome en el lenguaje y tengo problemas para conectar un JSP a un Servlet....

Este es el codigo que escribi:

"asd.jsp"

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Bienvenido</title>
</head>
<body>
<% out.println((String)(request.getAttribute("par"))); %>
</body>
</html>

"ramon.java"

package aa;
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ramon extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
public ramon() {
super();
}

public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

request.setAttribute("par", "AL FINNNNNNNNN!!!!!!!!!");
request.getRequestDispatcher("/asd.jsp").forward(request, response);


}
}

cuando ejecuto en el servidor "tomcat 5.5" me muestra por pantalla "null"

que paso¿? :(

espero una respuesta! gracias!!