I'm updating my JSP pages and Servlets to include response.encodeURL for links and such.
I've used response.encodeURL in the following attributes -
<form action>
<a href>
<frame src>
<input type="button" onclick> (javascript function called in onclick event)
But I'm unsure as to whether or not I should include encodeURL in the following where a servlet is called.
<script language="javascript">
function changeImage() {
//....
document.images["Image1"].src = "go.imageP?process=view&num=image1&size=large";
//....
}
The page isn't going anywhere, and I thought response.encodeURL was only necessary for links on the page, redirects (response.sendRedirect), form action attribute, and any object (like a button) that sends the page to another location.
Can someone please tell me if I should use response.encodeURL?