Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

printing it 2 times?

sam christopher
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am new bie to scriptlet codings..
here i in jsp page, i am trying to print "mesgbody" which is array list., from a class "ScrollMsg".
code is...

<jsp:useBean id="ScrollMsg" scope="request" class="com.sasd.bean.ScrollMsg" >

<jsp:getProperty name="ScrollMsg" property="mesgbody" />

for (int i=0;i<ScrollMsg.getTot();i++)
<span class="title">
<% java.util.ArrayList tmp = ScrollMsg.getMesgbody();



and my back end bean code...

public ArrayList getMesgbody() {
FacesContext context = FacesContext.getCurrentInstance();
ArrayList tmp = new ArrayList();
UserBean usb = (UserBean) httpSession.getAttribute("UserBean");
int empId = usb.getEmpId();

try {
session = getSession();

list = session.createQuery("Select sc ......bla bla .....asc").list();

int i=0;
Object[] msgtuple;

for(Iterator it =list.iterator(); it.hasNext();){
Smessagemst row = (Smessagemst);
String msghd =row.getMsghd().toString();
catch(Exception e){

return mesgbody;

and bak end bean it not much necessary in this case.....
anyway i put for the reference....

my backend process are all fine... and coming to jsp,
"out.println(tmp.get(i));" print my required output once , before that..

<jsp:getProperty name="ScrollMsg" property="mesgbody" /> is also print the same once.. ,
but the former one is not working properly, with out the latter one...
why ?? help me
[ September 08, 2006: Message edited by: Bear Bibeault ]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic