scripter73
Programmer
Hi,
Relatively new to Java. Can someone explain why I can't do the following? I have a function that grabs a database element called getCustId(). The function returns a double.
Here's what I want to say:
* Custdata is my database object.
HttpSession s = request.getSession();
s.setAttribute("custid",custdata.getCustId());
.....
s.getAttribute(session.getAttribute("custid"));
I get the following error:
Generated servlet error:
[javac] Compiling 1 source file
C:\Tomcat 5.0\work\Catalina\localhost\cust-webapp\org\apache\jsp\loginProcess_jsp.java:110: setAttribute(java.lang.String,java.lang.Object) in javax.servlet.http.HttpSession cannot be applied to (java.lang.String,double)
s.setAttribute("custid",userdata.getCustId());
^
1 error
Is there some sort of "mask" I can use?
Thanks in advance.
scripter73
Change Your Thinking, Change Your Life.
Relatively new to Java. Can someone explain why I can't do the following? I have a function that grabs a database element called getCustId(). The function returns a double.
Here's what I want to say:
* Custdata is my database object.
HttpSession s = request.getSession();
s.setAttribute("custid",custdata.getCustId());
.....
s.getAttribute(session.getAttribute("custid"));
I get the following error:
Generated servlet error:
[javac] Compiling 1 source file
C:\Tomcat 5.0\work\Catalina\localhost\cust-webapp\org\apache\jsp\loginProcess_jsp.java:110: setAttribute(java.lang.String,java.lang.Object) in javax.servlet.http.HttpSession cannot be applied to (java.lang.String,double)
s.setAttribute("custid",userdata.getCustId());
^
1 error
Is there some sort of "mask" I can use?
Thanks in advance.
scripter73
Change Your Thinking, Change Your Life.