File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes URL Parameters AND Encode in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "URL Parameters AND Encode in JSP" Watch "URL Parameters AND Encode in JSP" New topic

URL Parameters AND Encode in JSP

ming wu

Joined: Oct 07, 2001
Posts: 1
Hello all:
I have some problems with my jsp code, they have been bothering me for days.
I was trying to create a dynamic form which should displayed all the records stored in the Oracle database. Each record would be a hyper link, when you click it, you would be directed to another Edit page.
The way I am using to do the above is, get the file number from record set by rs.getString( "XXXX" ), then encode it and add it to the URL.
The code example is here:
out.println(" <td>");
out.println("<a href=\"FileRecord.jsp?" + "FileNumber=" + ( rs.getString("f_FILENUMBER") )+ "&\" ><font style=\"font-size: 10pt; font-family: Arial, Tahoma \">" + rs.getString("f_FILENUMBER") +"</font></a>");
/* f_FILENUMBER is the alies for the column FileNumber. */
out.println("</td>" );
And I've also tried another way: create a new StringBuffer, then append the URL and paramters to it. But neither of them worked. I really can't figure out why and how to solve the problem. If I can't append the parameters to the URL, then the next Edit page wouldn't be able to get the parameters and find the right file record.
Can anybody please help me out? Thank you very much.
I agree. Here's the link:
subject: URL Parameters AND Encode in JSP
jQuery in Action, 3rd edition