isn't it session.putValue("user",user) ??
On Mon, 12 Feb 2001, Jsp Joe wrote:
> .....mail id: [EMAIL PROTECTED]
>
>
> I am using jswdk-1.0.1
> I get the following error message when i try to run the JSP given below.....
>
>
> ----------------------------------------------------------------------------
> ------------
> Unhandled error! You might want to consider having an error page to report
> such
> errors more gracefully
> com.sun.jsp.JspException: Compilation
> failed:work\%3A8080%2Fexamples\jsp_0005cpl
> aytop_0005cuserlogin_0002ejspuserlogin_jsp_2.java:106: Method
> setAttribute(java.
> lang.String, playtop.User) not found in interface
> javax.servlet.http.HttpSession
> .
> session.setAttribute("user", user);
> ^
> ----------------------------------------------------------------------------
> ------------
>
>
> THE JSP :
> ----------------------------------------------------------------------------
> -------
> <%@ page language="java" import="playtop.*, java.util.*" %>
>
> <jsp:useBean id="loginBean" scope="page" class="playtop.Login">
> <jsp:setProperty name = "loginBean" property="*"/>
> </jsp:useBean>
>
> <% String moveto = "userlogin.html";
>
> User user = loginBean.checkuser();
>
> if (user != null) {
> session.setAttribute("user", user);
> System.out.println("User Logged in : " + user);
> session.setMaxInactiveInterval(1000);
> moveto = "showtoplists.jsp";
> }
> %>
>
> <jsp:forward page = "<%= moveto %>"/>
> ----------------------------------------------------------------------------
> -------
>
> THE BEAN its using
> ----------------------------------------------------------------------------
> --------
> package playtop;
>
>
> public class Login {
>
> private String username = "";
> private String password = "";
>
> public Login() { }
>
> public void setUsername(String username) {
> this.username = username;
> }
>
> public void setPassword(String password) {
> this.password = password;
> }
>
> public User checkuser() {
> if (username.equals("clive") && password.equals("bigboy")) {
> return new User("clive");
> } else if (username.equals("rahul") && password.equals("themaster")) {
> return new User("rahul");
> } else if (username.equals("nitin") && password.equals("married")) {
> return new User("nitin");
> } else {
> return null;
> }
> }
> }
> ----------------------------------------------------------------------------
> ------------------
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
> 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
>
T+
--------------------------------------------------------------------------
Rodrigo de Oliveira Lopes "Nao me entrego sem lutar
Mestrando em Ciencia da Computacao Tenho ainda coracao
Universidade Federal do Ceara Nao aprendi a me render
[EMAIL PROTECTED] Que caia o inimigo entao"
[EMAIL PROTECTED] Renato Russo
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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