I have a
Enter URL: <input type = "text" name= "aURL"/>
in my form and I want in JSP to become a clickable URL.
I tried with:
<% String aURL = request.getParameter("activityURL"); %>
<a href = "<%= aURL %>" ></a>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your link has no body (i.e. there’s nothing between
<a>and</a>), so nothing will visually appear as a clickable link. You need to give the link a body so that the enduser has something visible to click on.E.g. the text “click here”:
or just the URL itself:
See also:
Unrelated to the concrete problem: you’ve there a huge XSS attack hole with inlining user-controlled input unescaped among the HTML source code. This is pretty dangerous if your website has a sensitive backend and/or when there are sessions involved. Start learning JSTL/EL and discover the
fn:escapeXml()function to make it XSS attack safe.