• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URL Parameters AND Encode in JSP

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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=" +
java.net.URLEncoder.encode ( 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic