java.net.URLEncoder Issues in JSP Page

R

rick.huby

I am building a JSP website and have created a page template that has
two include pages - a navigation page and a footer page.

For obvious reasons I am using this for easier maintenance if
navigation or footer details change.

However the way that the navigation works I need to pass it a heading
value - and on some pages this will be dynamically obtained from a DB.

The code I am using is :

<jsp:include flush="true" page="/jspinc/nav.jsp">
<jsp:param name="heading1" value="<%=title%>" />
</jsp:include

I am getting a deprecation issue on using the a variable for the param
value, instead of hard coding it.

It all boils down to the java.net.URLEncoder class and specifically the
encode(String) method. This has been replaced by encode(String s,
String encType).

My problem is that I have no idea how to use this new method using the
syntax I already have. Can anybody help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top