huzefaq
asked on
Having prooblem with accessing EJB from JSP
Hi Guys
I have a JSP in which i need to get data From an Access Bean. Now in the access bean I call the finder method findByStoreId(storeId). This method gives me the whole ejb and then I need to call the getCRId() method to get only the id's and store it in a hashtable
i started with something like this, would anyody please help me how I can complete the code and if there is a way to get the id using usebean in JSTL. I would really appreciate any kind of help
Thanks
-------------------------- ---------- ---------- ---------- ---------- ---
SRSCashRegisterAccessBean crBean = new SRSCashRegisterAccessBean( );
Enumeration en = crBean.findByStoreId(new Long(storeId.substring(3,s toreId.len gth()-8))) ;
while (en.hasMoreElements()) {
crBean = (SRSCashRegisterAccessBean ) en.nextElement();
//Todo
call the getCrId() method and store data in a hashtable
//end Todo
}
I have a JSP in which i need to get data From an Access Bean. Now in the access bean I call the finder method findByStoreId(storeId). This method gives me the whole ejb and then I need to call the getCRId() method to get only the id's and store it in a hashtable
i started with something like this, would anyody please help me how I can complete the code and if there is a way to get the id using usebean in JSTL. I would really appreciate any kind of help
Thanks
--------------------------
SRSCashRegisterAccessBean crBean = new SRSCashRegisterAccessBean(
Enumeration en = crBean.findByStoreId(new Long(storeId.substring(3,s
while (en.hasMoreElements()) {
crBean = (SRSCashRegisterAccessBean
//Todo
call the getCrId() method and store data in a hashtable
//end Todo
}
using finder methods will be heavy for such senario's.
you can write a Home Business method to fetch all the Crid's as a collection object.
write a business method in home interface and in the bean class use ejbselect methods to query the database for all the crid's and return them as a collection object.
you can write a Home Business method to fetch all the Crid's as a collection object.
write a business method in home interface and in the bean class use ejbselect methods to query the database for all the crid's and return them as a collection object.
ASKER
yes can I change the whole code of accessing a finder method to JSTL.
Also mbvvsatish would u know of any tutorial or exaple which I can use to implement this. I know about entitiy EJB's but haven't worked on it much
Thanks guys
Also mbvvsatish would u know of any tutorial or exaple which I can use to implement this. I know about entitiy EJB's but haven't worked on it much
Thanks guys
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or if in jsp you have SRSCashRegisterAccessBean bean ?