Having searched the archives I thought I knew how to pass parameters to a
servlet when using the forward(request, response) method.

However I dont seem to be able to access the attributes I am setting.

My JSP code is as follows:

<%
request.setAttribute("tripId", "1/2");

RequestDispatcher rd =
etServletContext().getRequestDispatcher( "http://localhost:8080/servlet/com.
traveltech.servlet.Trip" );

rd.forward(request, response);
%>

The first line of the doGet() method in mu Trip servlet is as follows:

String tripId = (String) request.getAttribute("tripId");


The problem is that the tripId variable is always null. If I call
request.getAttributeNames() it returns an empty list.

Anyone know what I'm doing wrong? This is driving me up the wall.


Thanks
Matt

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to