Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Url Encoding and decoding

843840Oct 5 2009 — edited Oct 5 2009
Hi All,

I am trying to encode the url, pass spme parameters and decode them in another jsp.
Encoding:
<a href="<c:url value="abc.jsp">
				<c:param name="folder" value="${sectionValue.foldername}"/>
				<c:param name="filen" value="${fn:trim(sectionValue.filelink)}"/>
				</c:url>"
				target="_blank">${sectionValue.filename} (${sectionValue.filetype})</a>
Decoding in abc.jsp
<%
out.clear();
	out = pageContext.pushBody(); 
	String path ="E:\\web\\forms\\Current\\";
	String folder = request.getParameter("folder");
	String filen = URLDecoder.decode(request.getParameter("filen"), "UTF-8");
	path=path+folder+"\\"+filen;
	System.out.println(path);

%>
When I print this path, it still is T L Fam12.19.08.pdf instead of T + L Fam12.19.08.pdf.

It is encoding correctly , cause it is T%2bL%2520Fam12.19.08.pdf

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 2 2009
Added on Oct 5 2009
7 comments
1,299 views