About the game Fazuul which was shown in the book mastringEJB (50分)

  • 主题发起人 主题发起人 hozen
  • 开始时间 开始时间
H

hozen

Unregistered / Unconfirmed
GUEST, unregistred user!
I have written a game called Fazuul which was shown in the book masteringEJB. And I met a problem .
After I added the code
--------------------
public Component attachTo(Component other) throws RemoteException,ComponentException;
public String getName() throws RemoteException;
--------------------
in remote file Component.java, I added following code
--------------------
public Component attachTo(Component other) throws RemoteException,ComponentException{
Properties props=sessionContext.getEnvironment();
String matchString=(String)props.get(ENV_MATCHES);
Enumeration matches=new StringTokenizer(matchString,",");

while(matches.hasMoreElements()){
String equationString=(String)matches.nextElement();
Enumeration equation=new StringTokenizer(equationString,"+=");
String nameA=(String)equation.nextElement();
String nameB=(String)equation.nextElement();
String result=(String)equation.nextElement();

}
}
--------------------
in Bean file ComponentBean.java. And I tried to add the code
--------------------
other.getName();
--------------------
in the "while(){}" in above codes. But it cannot find the method called getName(). All what I can use is "this.getName()", so I cannot make a comparision between "this.getName()" with "other.getName()".
How to resolve this problem?
Hope for your answers.
Thank you!
 

Similar threads

A
回复
0
查看
932
Andreas Hausladen
A
A
回复
0
查看
806
Andreas Hausladen
A
I
回复
0
查看
721
import
I
I
回复
0
查看
3K
import
I
后退
顶部