Results 1 to 3 of 3
  1. #1
    Jack is offline Senior Member
    Join Date
    Jun 2007
    Posts
    130
    Rep Power
    0

    Default JSP tags problem

    I have the following problem: when I try to create a list that is inside of the vertical scroll the information of the list doesn't appear.
    Do I mix the tags? I want the list from a collection of objects
    Can you help me?

    my page.jsp:
    Java Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
    <%@taglib uri="/WEB-INF/struts-html-el.tld" prefix="html" %>
    <%@taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean" %>
    <%@page import="XXX.beans.UserBean" %>
    
    <html:html xhtml="true">
    <head>
    <title>XXX</title>
    </head>
    
    <body> 
    <form name="form1" method="post" action="${LISTAR_ACTION}">
    
    <html:select property="users" title="Users" size="4" multiple="false">
    <html:option value="all">ALL</html:option>
    
    <html:optionsCollection name="usersList" label="userId" value="userId" />
    </html:select>
    
    <input type="submit" name="List" value=" List" />
    </form>
    
    </body>
    </html:html>
    my code:
    Java Code:
    Collection usersList= new Vector();
    if (resultUsers != null ){
    while(resultUsers.next()){
    UserBean usrBO = new UserBean();
    usrBO.setName(resultUsers.getString("userId"));
    usrBO.setAuthModules(null);
    usrBO.setPasword(null);
    usersList.add(usrBO);
    } 
    }

  2. #2
    Peter is offline Senior Member
    Join Date
    Jun 2007
    Posts
    119
    Rep Power
    0

    Default

    The problem is that you don't send the collection to the JSP.
    Example:

    request.setAttribute("usersList", userList);

  3. #3
    Heather is offline Senior Member
    Join Date
    Jun 2007
    Posts
    164
    Rep Power
    8

    Default

    I don't think that it is the problem.
    the problem is that your collection is null
    check it and then tell us

Similar Threads

  1. Html tags within XML- need help
    By iamhappy in forum XML
    Replies: 2
    Last Post: 03-27-2008, 04:21 PM
  2. Help with Tags JSP
    By Marcus in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-04-2007, 02:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •