Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Why jsp can't get the Vector fill with user-defined class by theRemote interface?

Reply
Thread Tools

Why jsp can't get the Vector fill with user-defined class by theRemote interface?

 
 
Realove
Guest
Posts: n/a
 
      05-20-2008
Because It is a big project so i provide a model to express my
question,
Qestion is:I want get the Vector full fill with the a Object in Jsp.
but I can't get it,There will problem when test return,but we I
Choose String but no class a 's object ,It can be return
successful.It
seems that jsp Can't recognize the class a,,but I really include the
Ejb module in jsp's lib.and editor alse prompt a's information.
I alse test it in JBoss server It alse occur Exception!
I cant understand why,
so come to here ask why?Please help me,3ks very much!!!

---------------------------------------------------------------------------*-------------------------
I use Netbean 6.1,Glassfish.Ejb3
import javax.ejb.Stateless;


1.
@Stateless(mappedName="T")
public class vectorBean implements vectorRemote {
//Vector v;
//@PostConstruct
//public void Init(){v=new Vector}


public Vector test(){
Vector v=new Vector();
v.add(new a("alex",14));
return v; }
}


2. a is a simple class
public class a {
public String m;
public int n;


public a(String m, int n) {
this.m = m;
this.n = n;
}
getter,and setters!



}


3.Jsp
InitialContext ctx=new InitialContext();
//ShoppingCartRemote
s=(ShoppingCartRemote)ctx.lookup("shopcart");
vectorRemote s=(vectorRemote)ctx.lookup("T");
Vector v=s.test();
Enumeration e=v.elements();
while(e.hasMoreElements()){
a p=(a)e.nextElement();
out.println(p.m);
}

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why jsp can't get the Vector fill with user-defined class by theRemote interface? Realove Java 0 05-20-2008 03:29 AM
Initializing vector<vector<int> > and other vector questions... pmatos C++ 6 04-26-2007 05:39 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
How to declare the size, and fill vector<vector <T>> ? eb C++ 2 09-13-2006 01:45 PM
Free memory allocate by a STL vector, vector of vector, map of vector Allerdyce.John@gmail.com C++ 8 02-18-2006 12:48 AM



Advertisments