Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!

Jiaxu Gu

Greenhorn
+ Follow
since Oct 29, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jiaxu Gu

I tried to inject a stateless session bean into the JSF managed bean using netbeans 6.1+glassfish v2.
First I create an enterprise application with an ejb module and a web module,then create a Remote stateless session bean in the ejb module,and add a business method.
Next I add JSF Framework to the web module and add a java class and using netbeans context menu to config it as the managed bean in the face-config.xml,then I open the managed bean class and select context menu :enterprise resource->call enterprise bean and select the session bean I created. After that these two lines add to the file

but when I use the managed bean , I found the testBean is null.

I have search the web and found some usage(DI) like this,
Are there something wrong with what I'm doing?

ps:I know the Seam framework and the jndi lookup can fix it,
but here I just want to know why can't I inject ejb into my managed bean?
13 years ago
JSF
I have an Enterprise Application in my netbeans which has an ejb module and a web module. Now I use jndi lookup to access the ejbs from the JSP. Is there any means that I can use DI(@EJB) to Injection the beans to JSP?
Thanks
Hello Ranchers! I'm a senior student from Shanghai China, and I'm going to take the exam on Nov.27. I hope I can get a high score in the exam and continue my futher studies. Anyone want to encourage me? Anyway, I want to thank all of you for your help, bcos today is thanks-giving day. Haha!
Given that b and c refer to instances of wrapper classes, which two
statements are true? (Choose two)
A. b.equals (b) returns true.
B. b.equals(c) returns the same result as b == c.
C. b.eqials(c) can return false even if c.equals(b) returns true.
D. b.equals(c) throws an exception if b and c are different wrapper types.
E. b.equals(c) returns false if the type of wrapper objects is being compared are different.
Answer: B, C

Why is C correct?
Given:
12. void start () {
13. A a = new A ();
14. B b = new B ();
15. a.s (b);
16. b = null;
17. a = null;
18. System.out.println ("start completed");
19. }
When is the B object, created in line 14, eligible for garbage collection?
A. After line 16.
B. After line 17.
C. After line 18 (when the method ends).
D. There is no way to be absolutely certain.
E. The object is NOT eligible for garbage collection.
Answer: C
Please explain the answer,is it wrong?
Why is the line 20 can't be reached?
11. public class Test {
12. public void foo () {
13. assert false;
14. assert false;
15.}
16. public void bar () {
17. while (true) {
18. assert false;
19.}
20. assert false;
21. }
22. }
What causes compilation to fail? And why?
A. Line 13
B. Line 14
C. Line 18
D. Line 20
class A{
protected int method1(int a,int b){return 0;}}
Which two are valid in a class that extends class A,and Why?


A.public int method1(int a,int b){return 0;}
B.private int method1(int a,int b){return 0;}
C.private int method1(int a,long b){return 0;}
D.public short method1(int a,int b){return 0;}
E.static protected int method1(int a,int b){return 0;}