• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to send the value of one column in a table from JSP to servlet using href

 
Danny Baquilod
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<TR>
<TD><%=rs.getString(1)%></TD>
<TD><%=rs.getString(2)%></TD>
<TD><%=rs.getString(3)%></TD>
<TD><%=rs.getString(4)%></TD>
<TD><input type="button" value="Edit" onclick=""/></TD>
<td><a href="EditPo.jsp?id=%=rs.getString("2")"%>Edit</a></td>

</TR>

please assist. THanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35744
412
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Danny,
Welcome to CodeRanch!

What yo posted is the correct way of sending a parameter. Note that it is good practice to keep code (especially JDBC code) out of the JSP. Instead store it in the request attribute and read that in the JSP. Search MVC for more detail.
 
Danny Baquilod
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Danny,
Welcome to CodeRanch!

What yo posted is the correct way of sending a parameter. Note that it is good practice to keep code (especially JDBC code) out of the JSP. Instead store it in the request attribute and read that in the JSP. Search MVC for more detail.


Thanks Jeanne. I was able to solve the problem above. I'm just newbie in Java/Jsp tech but already practicing MVC at this stage.

Hope this site and people like you will help me in my learning journey in this technology.

Thank you once again.
Danny

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65531
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are new to JSP, I suggest you read the following articles:
  • The Secret Life of JSPs
  • The Front Man

  • Pay special attention in the second article as to why sending a resultset to a JSp is a poor practice.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!