sql - sanitize a foreign entity when called in Java -
i have table generated database table. in database table has foreign key linking database table. when print out field prints out full path such entity."" [""=""]. there way sanitize return result? trying link pages , things using results number. below in tickets jsp page see created link on sheetnum directs viewbuyer?"buyernum" when click link instead of going viewbuyer?1 goes viewbuyer?entity.buyerinfo[ buyernum=1 ]. want scrub out entity stuff , left value grabbing.
servlet
case "/tickets": try{ ticket = ticketdb.gettickets(); request.setattribute("ticket", ticket); } catch (numberformatexception ex) { ex.printstacktrace(); } break;
tickets.jsp
<div id="body"> <table id="buyertable"> <c:foreach var="ticket" items="${ticket}" varstatus="iter"> <tr class="${((iter.index % 2) == 0) ? 'grey' : 'white'}"> <td> ${ticket.ticketid} </td> <td> <a href="viewbuyer?${ticket.buyernum}"> ${ticket.sheetnum} </a> <br> </td> <td> ${ticket.lotnum} </td> <td> ${ticket.qty} </td> <td> ${ticket.price} </td> <td> ${ticket.description} </td> <td> ${ticket.buyernum} </td> <td> ${ticket.paid} </td> <td> ${ticket.taxable} </td> <td> ${ticket.buyerspre} </td> <td> ${ticket.dateposted} </td> <td> ${ticket.dateupdated} </td> </tr> </c:foreach> </table> </div>
Comments
Post a Comment