There is already an implicit session object available in every jsp page
provided it doesnot have a page directive stating that the page doesnot
participate in a session.
The error you are getting is because you are using the HttpSession class to
call the putValue method which is not static.
Instead use session.putValue("user", user);
Just a piece of advice, a closer look at the error generated would have
given you the above information as well.
Have a nice day.
With regards,
Sachin S. Khanna.
www.emailanorder.com
----- Original Message -----
From: sufi malak <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, September 23, 2000 11:57 PM
Subject: Another error 500 ???


> Could you please help me, I don't know how everybody is dealing with those
> errors, I made lot of search in the internet, but there is no reponse ,
here
> is my new  error 500 :
> 500 Internal Server Error
>
> Java Server Page Translation Error
>
> Error during compilation :
>
>
C:\JavaWebServer2.0\tmpdir\default\pagecompile\jsp\_ch05\_checkLogin.java:15
1:
> Can't make static reference to method void putValue(java.lang.String,
> java.lang.Object) in interface javax.servlet.http.HttpSession.
>                       HttpSession.putValue("user", (Object)user);
>                                           ^
> 1 error
>
> And the jsp code is like this :
> <%@ page language="java"
>          import="com.wrox.projsp.ch05.*, java.util.*"
>          errorPage="error.jsp" %>
>
> <jsp:useBean id="loginBean" scope="page"
class="com.wrox.projsp.ch05.Login">
>   <jsp:setProperty name="loginBean" property="*"/>
> </jsp:useBean>
>
> <jsp:useBean id="monitor" scope="application" class="java.util.HashMap"/>
>
> <%
>   String display = "showLogin.html";
>
>   User user = loginBean.authenticate();
>   System.out.println("The user is : " + user);
>
>   if (user != null) {
>     user.setIpAddr(request.getRemoteHost());
>
>     // Got user. Now do they already have a session?
>     if (monitor.containsKey(user)) {
>       HttpSession oldSession = (HttpSession)monitor.get(user);
>       // If we want to complete an old order, uncomment these lines,
> recoverOrder
>
>     }
>
>     file://session.setAttribute("user", (Object)user); not working too
>       HttpSession.putValue("user", (Object)user);
>     monitor.put(user, session);
>     System.out.println("Assigned new session for: " + user);
>
>     session.setMaxInactiveInterval(900);
>
>     action=1" : "browse.jsp";
>    display = "browse.jsp";
>   }
> %>
>
> Thanks
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to