Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incompatible type for declaration. 1

Status
Not open for further replies.

112055

Programmer
May 13, 2002
61
US
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(&quot;User&quot;) == null)
{
%>
<SCRIPT Language=&quot;Javascript&quot;>
self.location = &quot;index.jsp&quot;;
</SCRIPT>
<%
}
else
{


BBUser theUser = (BBUser) mySession.getAttribute(&quot;User&quot;);
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(&quot;userAction&quot;));
String temp_Dealer_ID = OPSys.stripNull(request.getParameter(&quot;dealerID&quot;));
String temp_User_ID = OPSys.stripNull(request.getParameter(&quot;userID&quot;));
String temp_User_Name = OPSys.stripNull(request.getParameter(&quot;userName&quot;));

if(!temp_User_Action.equals(&quot;addUser&quot;))

{

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();


---------
 
ummm.. you mean this

BBUser aUser = theUser;
// now go ahead and use aUser
temp_User_Name = aUser.getName();


-pete
 
pete..your the best!!!..(o: I can see my page show up ..it's buggy but way better than nothing..thanks again Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top