Robert Legnosky

Greenhorn
+ Follow
since Jan 31, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Robert Legnosky

YES!!! Thanks BB...got the results I was looking for...

EmployeeDDLServlet.java



DDLResults.jsp



ViewEmployeeServlet.java

11 years ago
Thanks BB. Iterating over the list of employees was not the problem I had. Maybe I just wasn't clear.

My issue was that once I have the list, how can I click on one employee and get their pertinent info?

Is the code below possible...


My initial code gave me a list of the employees....

[1, Davolio, Nancy, Sales Representative] --- these are all hyperliked
[2, Fuller, Andrew, Vice President, Sales]
[3, Leverling, Janet, Sales Representative]
[4, Peacock, Margaret, Sales Representative]
[5, Buchanan, Steven, Sales Manager]
[6, Suyama, Michael, Sales Representative]
[7, King, Robert, Sales Representative]
[8, Callahan, Laura, Inside Sales Coordinator]
[9, Dodsworth, Anne, Sales Representative]

However when I clicked on anyone I was only getting the profile info for #9. I attributed it to me creating the session object and only the last complete row of information was being sent to my employeesDetail.jsp (see my first post).

Am I making sense?
11 years ago
now I'm just stuck




To answer your earlier questions about having two loops, the inner loop



gave me this on result on the page...

[1, Davolio, Nancy, Sales Representative]

The first four columns of my database (ID, LastName, FirstName, Title)

The outer loop gave me this result...the rows.

1, Davolio, Nancy, Sales Representative]
[2, Fuller, Andrew, Vice President, Sales]
[3, Leverling, Janet, Sales Representative]
[4, Peacock, Margaret, Sales Representative]
[5, Buchanan, Steven, Sales Manager]
[6, Suyama, Michael, Sales Representative]
[7, King, Robert, Sales Representative]
[8, Callahan, Laura, Inside Sales Coordinator]
[9, Dodsworth, Anne, Sales Representative]

11 years ago
am i getting any closer BB?


11 years ago
I didn't ditch the idea of the jsp. I added the HTML in the servlet just to test it quickly to see results.

Thanks for your help. I'll figure it out.
11 years ago
is this what you had in mind? excuse the html in the servlet...just for quick viewing purposes

11 years ago
Thanks BB,

I just want to make sure that I understand you....your are suggesting that I create a new bean object and save the results of the loop to it?



i'm pretty new to this so excuse my greenhorn ignorance.

And then in my jsp do I need do call the bean using <jsp:useBean>?
11 years ago
I'm working on a simple web application as a personal project to keep learning new things in Java.

So, I have a web page that allows the user to view employees in the department that he/she selects (ddl...you can select sales dept for example.)

A list of employees are returned. No problem so far. I would like the user then to be able to click on the any employee's name to get the employee's information. I'm using result set to return the list of employees. I am creating a session object to pass the pertinent employee info. The problem I'm running into is that if you click any of the ee's, you get the last ee's on the list info every the time. I suspect its because i'm using session.

code below...

EmployeeDDLServlet.java



DDLResults.jsp



EmployeeResults.jsp

11 years ago