• Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing variables from one JSP to another

 
Julia Irving
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've created a JSP that displays and links all of the files and folders in a directory. When someone clicks on a folder link, it opens a new JSP page where it displays the files in that folder. I am doing this by passing the directory name and path in a URL query string. It doesn't work when white spaces appear in the folder name. Please let me know if you can think of another way to pass these parameters. Thanks in advance.
Julia
 
Charles Hasegawa
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried using <jsp:forward> with embedded <jsp:param>?
[ August 14, 2003: Message edited by: Charles Hasegawa ]
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to encode the Query parameters You can run then through java.net.URLEncoder which replaces all special characters.

BTW !@#$!&*^ Graemlins, check the box Disable smiles in this post under options below
 
Charles Hasegawa
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahhhhhhh - I never scrolled my screen down far enough to see that!!
 
Julia Irving
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for the suggestions! I got it to work easily with URLEncoder. Thanks again!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!