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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic URLs with Java Beans

Status
Not open for further replies.

Josh6273

Programmer
Nov 13, 2001
17
0
0
US
Hi all -
I'm really pulling my hair out on this one and am facing a pretty harsh deadline.

I am writing a pretty basic contact management web app. In one page "employeeExpansion.jsp", I am pulling all of the employees in the database down using a Jakarta's DBTags tag library. This returns a list of employee contact IDs, and I am then setting the contact ID to my employeeInfo bean:

<jsp:useBean id=&quot;employeeInfo&quot; class=&quot;com.jta.htdata.db.beans.EmployeeInfoBean&quot; scope=&quot;application&quot;>
</jsp:useBean>

<sql:resultSet id=&quot;empRset&quot;>

<sql:getColumn position=&quot;1&quot; to=&quot;contactId&quot; scope=&quot;request&quot;/>
<jsp:setProperty name=&quot;employeeInfo&quot; property=&quot;contactId&quot; value = '<%= request.getAttribute(&quot;contactId&quot;) %>' />
Bean's ContactId = <jsp:getProperty name=&quot;employeeInfo&quot; property=&quot;contactId&quot; />

This all appears to work correctly. When I click on the resulting URL, I want to display a page with all of the Employee's pertinent information (title, address, etc.) This is all handled through the bean. The resulting page (employeeInfo.jsp) begins with the following jsp:usebean tag:

<jsp:useBean id=&quot;employeeInfo&quot; class=&quot;com.jta.htdata.db.beans.EmployeeInfoBean&quot; scope=&quot;application&quot;>
<jsp:setProperty name=&quot;employeeInfo&quot; property=&quot;*&quot;/>
</jsp:useBean>

But it isn't allowing me to get to the selected Employee's information.

I assume that this is a scoping issue, but I don't know what I am doing wrong.

Could someone please point me in the right direction or give me an idea of how to handle these dynamically generated URLs better?

Thanks!
Josh


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top