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...??
deepanpAsked:
Who is Participating?
 
radarshConnect With a Mentor Commented:
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.