JSP column name hyperlink help

i have a question. i need to figure out how to make all fields called ord_ID in a table hyperlinks to a different JSP page with the value of the ord_ID as a parameter as a query string(value) to the receiving JSP page. this is what i have so far:

Thnaks, i did not know that. i thought it was some sort of getVariable thing. So, i changed it to how you said and my code is now:

it does populate the table with all of the correct data, but my links for my Ord_ID fields are still not working, so basically the first <c:if> statement is not doing its job, so maybe the test is put wron?

So the <a> tag is never appearing when you think that it should? That would mean that columnName never equals "ORD_ID". Are you sure that it does as some point when you expect it to?

Benjamin Calderon
Greenhorn

Joined: Aug 09, 2011
Posts: 10

posted Aug 10, 2011 11:10:22

0

So, here is still what i have. i know that embedding SQL query directly into JSP pages is not a good idea, but ive done it so that you can see the quer that i am sending. the param.partyID is from a sepreate JSP that inputs a Member ID number in a text fields and sends it as a parameter. so, again. i need those order ID numbers to be links to a page that corresponds to them. it is the t_ord.ORD_ID that i want to be links for every one that is in the database.

Well, I would say that if the column name was actually "t_ord.ORD_ID" then comparing to "ORD_ID" would not do what you want. But you have something which outputs the actual column names now... it would have been interesting to see what its output was.

Benjamin Calderon
Greenhorn

Joined: Aug 09, 2011
Posts: 10

posted Aug 10, 2011 11:19:52

0

Paul Clapham wrote:Well, I would say that if the column name was actually "t_ord.ORD_ID" then comparing to "ORD_ID" would not do what you want. But you have something which outputs the actual column names now... it would have been interesting to see what its output was.

the column name isnt "t_ord.ORD_ID", when i run this, it runs as i expected and creates a table with all the column headers i specified as well as all the data i wanted. and the column name is "ORD_ID". I want all of the data that is from "ORD_ID" as links.

Okay. So that's the first column, right? Then just make the first column a link. Or am I missing something that you're trying to ask now?

Benjamin Calderon
Greenhorn

Joined: Aug 09, 2011
Posts: 10

posted Aug 10, 2011 11:36:27

0

Paul Clapham wrote:Okay. So that's the first column, right? Then just make the first column a link. Or am I missing something that you're trying to ask now?

Im new to this stuff, Im an intern at a company and i was told to do something like this a practice and just to figure it out however i could including forums, google, etc. So im basically in a learning position so im not sure how to make just the first column a link. is there like a column.count thing i could use and if the count is equal to column one that it makes it a link, and if not it is made how it normally is?

Sure there is. The <c:forEach> element has a varStatus attribute which returns an object with "index", "count", "first", and "last" properties. I always have to look this sort of thing up, which is why I have the JSTL Quick Reference sitting on my desk.

Benjamin Calderon
Greenhorn

Joined: Aug 09, 2011
Posts: 10

posted Aug 10, 2011 12:15:51

0

Swet, i got it to work. I just added that varStatus to the column <c:forEach> tag and added a little more code and it finally works, thanks to everyone that helped :)

I would have used a <c:choose> rather that two <c:if> elements with similar but opposite tests. Easier for maintenance: if you have to change the test, you want to avoid having to do it in two different places.

Also instead of

Use booleans the way booleans are meant to be used:

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com