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!

Using response.encodeURL method in JSP Page - do I need it in the src??

843840May 21 2010 — edited May 24 2010
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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 21 2010
Added on May 21 2010
5 comments
830 views