Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to show info from bean on jsp page ? 1

Status
Not open for further replies.

Ngai88

Programmer
Sep 8, 2004
56
US
hello,
I am learning jsp as I go.
Now I have the beans getting the data I want and displaying it properly in the dos window...

Username is: test3
incidentName is: Hurricane Ivan
functionName is: Volunteer Organizations

Can anyone show me how I can display this info on the jsp page?

Thanks,
Ngai

==========================================================
<%@ include file="/taglibs.jsp"%>
<%@ page import="com.EBU.cms.util.SessionUtil,
com.EBU.cms.bean.UserBean" %>

<%
UserBean UB= (UserBean)session.getAttribute("UserBean");
String username=UB.getUserName();
String incidentName=UB.getIncidentName();
String functionName = UB.getFunctionName();
System.out.println("Username is: " + username);
System.out.println("incidentName is: " + incidentName);
System.out.println("functionName is: " + functionName);
%>
 
One way :

Code:
<% 
   UserBean UB= (UserBean)session.getAttribute("UserBean");
   String username=UB.getUserName();
   String incidentName=UB.getIncidentName();
   String functionName = UB.getFunctionName();
%> 
<table>
  <tr>
    <td>UserName</td><td><%= username %> </td>
  </tr>
  <tr>
    <td>Incident Name</td><td><%= incidentName %> </td>
  </tr>
  <tr>
    <td>Function Name</td><td><%= functionName %> </td>
  </tr>
</table>

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top