use BBUser aUser = (BBUser)theUser.getUserID();
or
public BBUser getUserID()
{
return (BBUser)m_userID.toUpperCase().trim();
}
or
public Object getUserID() (** not sure about this one **)
{
return (BBUser)m_userID.toUpperCase().trim();
}
Amit
-Original Message-
From: Avy Wong [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 25, 2003 2:24 AM
To: [EMAIL PROTECTED]
Subject: Incompatible type for declaration.
Hello,
I am learning JSP as I go
Can anyone tell me how to set it up so that I use aUser to fetch
stuff inside BBUser
Many, many thanks,
Ngai
--
<%
HttpSession mySession = pageContext.getSession();
if(mySession.getAttribute("User") == null)
{
%>
self.location = "index.jsp";
<%
}
else
{
BBUser theUser = (BBUser) mySession.getAttribute("User");
BBClient theClient= theUser.getClient();
BBUser aUser = theUser.getUserID();<~~ what to do??? I want to set
it up so that I can call everything inside BBUser. ...
getUserID return a String ( see method below)
String temp_User_Action =
OPSys.stripNull(request.getParameter("userAction"));
String temp_Dealer_ID =
OPSys.stripNull(request.getParameter("dealerID"));
String temp_User_ID =
OPSys.stripNull(request.getParameter("userID"));
String temp_User_Name =
OPSys.stripNull(request.getParameter("userName"));
if(!temp_User_Action.equals("addUser"))
{
aUser = BBUser.getUser(temp_User_ID); <~~ before of previous
problem, I can't set this up properly..need help on this !!
temp_User_Name = aUser.getName();
}
}
-
An error occurred between lines: 30 and 123 in the jsp file: /mUser.jsp
Generated servlet error:
D:\Tomcat\work\Standalone\localhost\BB\mUser$jsp.java:115: Incompatible type
for declaration. Can't convert java.lang.String to com.bb.BBUser.
BBUser aUser = theUser.getUserID();
1 error, 1 warning
--
In the methods of BBUser, this is one of the method called getUserID().
public String getUserID()
{
return m_userID.toUpperCase().trim();
-
==To
unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com