getAttribute() takes only one parameter (a string): Object o =
request.getAttribute(String name);
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ramakrishnan
Venkataraman
Sent: Thursday, July 13, 2000 12:57 PM
To: [EMAIL PROTECTED]
Subject: Unable to use request.getAttribute() in a JSP page
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01BFECEB.4F433EE0
Content-Type: text/plain;
charset="windows-1252"
I am trying to forward a request from a servlet to a JSP.
To pass information from the servlet to the JSP page, I use
request.setAttribute(String, String) in the servlet.
To call the JSP page I do:
getServletConfig().getServletContext().getRequestDispatcher(<jsp
page>).forward(request, response);
But the JSP fails with the following error:
----------------------------------------------
500 Internal Server Error
com.livesoftware.jsp.JSPServlet:
java.lang.NullPointerException:
----------------------------------------------
In the JSP page I have expressions like <%=request.getAttribute(String,
String)%>.
I also simply tried to call the JSP page from the browser, that also gives
the same problem if I use <%=request.getAttribute(String, String)%> in the
JSP page.
(Incidentally if I do a redirect() to the JSP page passing a query string,
it works correctly (of course, in the JSP I then use
<%=request.getParameter(String, String)%> )
I am using JRun 2.3.3 on Win NT 4.0 server.
Any idea what I am doing wrong ?
Thanks in advance for any pointers.
- Ramakrishnan Venkataraman
Email: [EMAIL PROTECTED]
------_=_NextPart_001_01BFECEB.4F433EE0
Content-Type: text/html;
charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dwindows-1252">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2651.65">
<TITLE>Unable to use request.getAttribute() in a JSP page</TITLE>
</HEAD>
<BODY>
<BR>
<P><FONT SIZE=3D2>I am trying to forward a request from a servlet to a =
JSP.</FONT>
</P>
<P><FONT SIZE=3D2>To pass information from the servlet to the JSP page, =
I use request.setAttribute(String, String) in the servlet.</FONT>
</P>
<P><FONT SIZE=3D2>To call the JSP page I do: </FONT>
</P>
<P> <FONT =
SIZE=3D2>getServletConfig().getServletContext().getRequestDispatcher(<=
;jsp page>).forward(request, response); </FONT>
</P>
<P><FONT SIZE=3D2>But the JSP fails with the following error:</FONT>
</P>
<P><FONT SIZE=3D2>----------------------------------------------</FONT>
<BR><FONT SIZE=3D2>500 Internal Server Error</FONT>
<BR><FONT SIZE=3D2>com.livesoftware.jsp.JSPServlet:</FONT>
</P>
<P><FONT SIZE=3D2>java.lang.NullPointerException: </FONT>
</P>
<P><FONT SIZE=3D2>----------------------------------------------</FONT>
</P>
<P><FONT SIZE=3D2>In the JSP page I have expressions like =
<%=3Drequest.getAttribute(String, String)%>.</FONT>
</P>
<P><FONT SIZE=3D2>I also simply tried to call the JSP page from the =
browser, that also gives the same problem if I use =
<%=3Drequest.getAttribute(String, String)%> in the JSP =
page.</FONT></P>
<P><FONT SIZE=3D2>(Incidentally if I do a redirect() to the JSP page =
passing a query string, it works correctly (of course, in the JSP I =
then use <%=3Drequest.getParameter(String, String)%> )</FONT></P>
<P><FONT SIZE=3D2>I am using JRun 2.3.3 on Win NT 4.0 server.</FONT>
</P>
<P><FONT SIZE=3D2>Any idea what I am doing wrong ?</FONT>
</P>
<P><FONT SIZE=3D2>Thanks in advance for any pointers.</FONT>
</P>
<P><FONT SIZE=3D2>- Ramakrishnan Venkataraman</FONT>
<BR><FONT SIZE=3D2> Email: [EMAIL PROTECTED]</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01BFECEB.4F433EE0--
----------------------------------------------------------------------------
--
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe:
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe'
in the body.
------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.