You are mixing up two JSP tags: scriptlet <% %> and print <%= %>
the error you recive is becouse you enclosed the call to setAtribute in a
print tag, and that method returns void while the print tag expects an
Object or a primitive. try using this code:
<% request.setAttribute("name",name); %>
lee
Hi there,
The following code gives error:
*************************************************
<html>
<head><title></title></head>
<body>
<h4>This is the parameter that you passed </h4>
<%@ page language="java" contentType="text/html" session="true" %>
<% String name=""; %>
<%=
name=request.getParameter("name")
%>
<%=
request.setAttribute("name",name)
%>
I also tried
session.putValue("name",name)
&
session.setAttribute("name",name)
</body></html>
***********************************
Error is: Unable to convert void to java.lang.Object
request.setAttribute("name",name)
/\
************************************
What I tried to do was get value entered in an HTML page's text field
called 'name' & put it is a session variable so that I can access it
from another JSP or servlet.
Kindly help me out!!!
Thanx in advance.
Rgds,
Mythili
===========================================================================
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
===========================================================================
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