Hi i have a code that runs really well.. unfortunately im really new and to get to here was also quite time consuming.. however i am on a short time line now and need help fast!. can someone please tell me how i can get my page to list results of this nature : select * from S_USER where active= 'Y' instaed of select * from S_USER.
Below is my code.. sorry for the long code.. but like is aid i need help fast!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
<html>
<head>
<%@ include file="/header.jsp" %>
<%@ page import = "com.synfoserv.beans.*" %>
<%@ page import = "java.util.*" %>
<jsp:useBean id="listing" class="java.util.ArrayList" scope="request"></jsp:useBean>
<title><database:label controlname="header_userlist" disablebold="true"/></title>
 
        
<SCRIPT language="JavaScript">
function deleteRecord(userid) {
        document.forms[0].cmd.value = "suser_delete";
        document.forms[0].userid.value = userid;
        document.forms[0].submit();
        
}
 
function deleteRecord(userid) {
        var msg = 'Delete User?';
        var x=window.confirm(msg)
        if (x) {
                document.forms[0].cmd.value = "suser_delete";
                document.forms[0].userid.value = userid;
                
                parent.main_mid.location = "Controller?cmd=blank_page";
                document.forms[0].submit();
        }
}
parent.main_mid.location = "Controller?cmd=blank_page";
parent.menu.location = "Controller?cmd=remove_company";
parent.main_bottom.location = "Controller?cmd=blank_page";
</SCRIPT>       
</head>
<%
 
UserBean uBean = (UserBean) session.getAttribute("userbean");
Hashtable htSecurity = uBean.getSecurity();
SecurityBean sb = (SecurityBean) htSecurity.get("USER");
 
boolean bSecurityRight=false;
 
bSecurityRight=sb.getDelete();
 
 
%>
<body class=stdbody>
<form name=dataentry action="Controller" method="post">
<input type="hidden" name="cmd" value="">
<input type="hidden" name="userid" value="">
<TABLE width="100%" cellpadding="0" cellspacing="0">
  <TR>
    <TD  colspan="4">
      <TABLE width="100%" cellpadding="0" cellspacing="1">
        <TR>
          <TD class=titlerow><database:label controlname="header_userlist" disablebold="true"/></TD>
        </TR>
          </TABLE>
        </TD>
  </TR>
  <TR>
  <TR>
   <TD>
      <TABLE width="100%" border="0">
        <TR>
          <TD class=headerow>Connected</TD>
          <TD class=headerow><database:label controlname="user"/></TD>
          <TD class=headerow><database:label controlname="fname"/></TD>
          <TD class=headerow><database:label controlname="lname"/></TD>
          <TD class=headerow><database:label controlname="department"/></TD>
          <TD class=headerow><database:label controlname="phone"/></TD>
          <TD class=headerow><database:label controlname="email"/></TD>
          <td class=headerow></td>
        </TR>
<%
Iterator iter = listing.iterator();
boolean isHighlighed = false;
boolean hasrows = false;
int intListCount = 0;
while (iter.hasNext()){
        intListCount++;
        hasrows = true;
        SUserListBean  ulbObj = (SUserListBean) iter.next();
        %>      
        <TR class= <% if (isHighlighed){
                                out.println ("labelcolumn");
                        } else {
                                out.println ("textcolumn");
                        }
                %>onmouseover='this.style.backgroundColor = "#CC9933";this.style.cursor="hand";' onmouseout='this.style.backgroundColor = "";this.style.cursor="default";' this.style.cursor='default'">
<!-- 
          <TD onClick="parent.main_bottom.location='Controller?cmd=suser_edit&userid=<%=ulbObj.getUserId()%>'"><%=ulbObj.getUserId()%></TD>
          <TD onClick="parent.main_bottom.location='Controller?cmd=suser_edit&userid=<%=ulbObj.getUserId()%>'"><%=ulbObj.getFName()%></TD>
          <TD onClick="parent.main_bottom.location='Controller?cmd=suser_edit&userid=<%=ulbObj.getUserId()%>'"><%=ulbObj.getLName()%></TD>
          <TD onClick="parent.main_bottom.location='Controller?cmd=suser_edit&userid=<%=ulbObj.getUserId()%>'"><%=ulbObj.getDepartment()%></TD>
          <TD onClick="parent.main_bottom.location='Controller?cmd=suser_edit&userid=<%=ulbObj.getUserId()%>'"><%=ulbObj.getPhone()%></TD>
          <TD onClick="parent.main_bottom.location='Controller?cmd=suser_edit&userid=<%=ulbObj.getUserId()%>'"><%=ulbObj.getEmail()%></TD>
-->
          <TD onClick="javascript:loadEditFrame('Controller?cmd=suser_edit&userid=<%=ulbObj.getUserId()%>')"><%=ulbObj.getConnected()%></TD>
          <TD onClick="javascript:loadEditFrame('Controller?cmd=suser_edit&userid=<%=ulbObj.getUserId()%>')"><%=ulbObj.getUserId()%></TD>
          <TD onClick="javascript:loadEditFrame('Controller?cmd=suser_edit&userid=<%=ulbObj.getUserId()%>')"><%=ulbObj.getFName()%></TD>
          <TD onClick="javascript:loadEditFrame('Controller?cmd=suser_edit&userid=<%=ulbObj.getUserId()%>')"><%=ulbObj.getLName()%></TD>
          <TD onClick="javascript:loadEditFrame('Controller?cmd=suser_edit&userid=<%=ulbObj.getUserId()%>')"><%=ulbObj.getDepartment()%></TD>
          <TD onClick="javascript:loadEditFrame('Controller?cmd=suser_edit&userid=<%=ulbObj.getUserId()%>')"><%=ulbObj.getPhone()%></TD>
          <TD onClick="javascript:loadEditFrame('Controller?cmd=suser_edit&userid=<%=ulbObj.getUserId()%>')"><%=ulbObj.getEmail()%></TD>
          <%if (bSecurityRight){%>
          <TD onClick="deleteRecord('<%=ulbObj.getUserId()%>')"><img src="<%=htConfig.get("delete_button")%>" border="0" alt="" width="15" height="15"></TD>
          <%}else{%>
          <TD><img src="<%=htConfig.get("delete_button_disabled")%>" border="0" alt="" width="15" height="15"></TD>
          <%}%>
        </TR>
        
 <% isHighlighed = !isHighlighed;
 }
if (!hasrows){
 
 %>
 <TR class=textcolumn>
                        <td colspan=9><database:label controlname="norecord"/></td>
         
                </TR>
 
 <%} 
else{%>
  <TR class=labelcolumn>
    <td colspan=1>List Count</td>
    <td colspan=11><%=intListCount%></td>
  </TR>
<%}%>
        </TABLE>
</body>
</html>

Nope. You're not going to get anything but a massive spanking for writing such rubbish!

How often do we have to repeat that one should NEVER use Java code in JSP?
And NEVER means NEVER, and that goes for you too, not just for others.

thanks for your reply.. but i stil need help in getting my code to display the list of active users and ur post really doesnt help.

it should help.
Rewrite that entire piece of garbage to proper standards.
If you still have problems, maybe someone will help you.
But I'm not going to "fix" rubbish like that to make it seem to work, as it's fundamentally broken at a conceptual level.

This article has been dead for over six months. Start a new discussion instead.