A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
JSP
Author
Use input as a URL in JSP?
Kyupa Supa
Ranch Hand
Joined: Jun 23, 2012
Posts: 30
posted
Aug 24, 2012 12:43:56
0
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>
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16487
2
I like...
posted
Aug 24, 2012 13:09:50
0
And?
Seems like it should work okay to me. Did you have some kind of problem?
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
I like...
posted
Aug 24, 2012 13:20:32
0
aURL == activityURL ? and hope you submitted the form to jsp.
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56554
14
I like...
posted
Aug 24, 2012 13:26:10
0
Scriptlets in a JSP? In 2012?
Please read
this JspFaq entry
.
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56554
14
I like...
posted
Aug 24, 2012 13:28:12
0
Seetharaman Venkatasamy wrote:
and hope you submitted the form to jsp.
I hope not! Submitting a form to a view resource like a JSP is a poor practice indeed!
Stefan Evans
Bartender
Joined: Jul 06, 2005
Posts: 1008
posted
Aug 26, 2012 14:33:59
0
Converting it to EL would be relatively simple:
<a href="${param.aURL}">Make sure you put text here so that people can click the link!</a> //or <a href="${param.activityURL}">Make sure you put text here so that people can click the link!</a>
depending upon what your actual request parameter is.
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: Use input as a URL in JSP?
Similar Threads
Classloader issues
HttpsURLConnection ClassCastException Question
Update Webpage from Applet?
Loading classes from a Jar file problem
Loading Classes From A Jar File Problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter