Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Passing a URL through a URL in JSP

Posted on 2006-11-24
3
Medium Priority
?
186 Views
Last Modified: 2010-04-01
I'm trying to pass a URL to another URL in JSP.

someething like:

 <a href="http://www.mysite.com/?followOnUrl=<c:out value="${myForm.followOnURL} />"> Click for Link </a>


How do i make sure that the c:out data is escaped properly since it contains url.  I don't want my first page to misinterpret the followOnUrl variable.

Example?
0
Comment
Question by:tmonteit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Accepted Solution

by:
enachemc earned 800 total points
ID: 18011007
use URLEncoder.encodeURL()
0
 
LVL 28

Assisted Solution

by:rrz
rrz earned 800 total points
ID: 18011659
I agree with  enachemc.  The solution looks something like this.
<%@ page import="java.net.URLEncoder"%>
<a href="http://www.mysite.com/?followOnUrl=<%=URLEncoder.encode(myForm.getFollowOnURL(),"UTF-8")%> />"> Click for Link </a>    
0
 

Author Comment

by:tmonteit
ID: 18017072
Nice....

solution to enachemc

Points to rrz@871311  for the example.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whoever said that “a picture is worth one thousand words” observed a fact that can dramatically affect your marketing success. Most people tend to learn visually, so many publishers commonly acknowledge the effectiveness of visual learning by using…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question