[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

JSP general question for EASY 50 POINTS!!

Hi, i am curious, how would you write a jsp say called admin.jsp and have it display all the UserData instances currently held in the instance of Users..

The instances of Users are held in the class file public class Users...??
0
deepanp
Asked:
deepanp
  • 2
  • 2
1 Solution
 
fargoCommented:
yyeah that's easy. You can first try urself and let us know if u find any difficulties.
0
 
deepanpAuthor Commented:
Sorry when i meant easy, i meant easy for some but not for me since i haven't done JSP before:S??
0
 
radarshCommented:
How are the Users instances stored? As an array or arraylist?

In that case, you can do something like this:

<%
    Users users = UserData.getUsers();

    for(int i = 0; i < users.length; i++)
    {
%>

<b> User : <%=users[i]%> </b>

<%
    }
%>

________
radarsh
0
 
deepanpAuthor Commented:
say its an array.. this is based only on an example, you can make it up ne way possible??

>> i just need to get a grasp knowledge of how to make instances etc in java beans..:)

Thanks for the reply..
0
 
radarshCommented:
Where is the instance of UserData class stored?

It should be ideally in session or application scope.

You need to use the <jsp:useBean directive for accessing the beans.

http://java.sun.com/products/jsp/tags/11/syntaxref11.fm14.html

The above link explains a lot about it.


________
radarsh
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now