| Author |
Enabling dynamic hyperlinks
|
Adewale Adebusoye
Ranch Hand
Joined: Sep 28, 2005
Posts: 118
|
|
Hello.. ive got this email application that uses servlets and jsps. I would like to make it so that when anyone types in a URL address when he's composing a mail, it automatically becomes a live hyperlink in the page, without me having to write <a href.....blah blah> Also, if anyone sends me a mail...and its got a hyperlink in it...the hyperlink should also become alive. I hope i dont sound confusing and u all get my idea..its kinda how yahoo does it. Thanks
|
"Human beings can alter their lives by altering their state of mind" William James
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
Hello.. ive got this email application that uses servlets and jsps. I would like to make it so that when anyone types in a URL address when he's composing a mail, it automatically becomes a live hyperlink in the page, without me having to write <a href.....blah blah>
You'd have to do that with JavaScript. You would have to parse the text as it is changed by the user and update it accordingly. You might like to ask this quetion in the HTML forum - someone will probably know how to do it.
Also, if anyone sends me a mail...and its got a hyperlink in it...the hyperlink should also become alive
That is up to which ever mail client you use. Most do this automagically these days.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Adewale Adebusoye
Ranch Hand
Joined: Sep 28, 2005
Posts: 118
|
|
|
Well im actually writing my own email client..so id like to know how to enable any links in anymail sent to me
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
In which case you have posted this in the wrong forum. I'm assuming you are using Swing?
|
 |
Adewale Adebusoye
Ranch Hand
Joined: Sep 28, 2005
Posts: 118
|
|
No its just pure HTML with jsp/servlets. I was under the assumption that it wasnt possible using swing in a web application. If im in the wrong forum..where should i repost?
|
 |
Adewale Adebusoye
Ranch Hand
Joined: Sep 28, 2005
Posts: 118
|
|
No its just pure HTML with jsp/servlets. I was under the assumption that it wasnt possible using swing in a web application. If im in the wrong forum..where should i repost?
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
No its just pure HTML with jsp/servlets.
OK. In that case the first part of your question is a JavaScript question. Ask in the HTML forum and should be able to give you an answer. Redisplaying mails you can do in your Servlet. You'll need to capture what text is (possibly) a link and add the <a /> element. The obvious API you could use for this is java.util.regex.
I was under the assumption that it wasnt possible using swing in a web application.
True - you can't use any of the AWT/Swing APIs in a Servlet. You could however use them in an Applet.
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Originally posted by Adewale Adebusoye: No its just pure HTML with jsp/servlets. I was under the assumption that it wasnt possible using swing in a web application. If im in the wrong forum..where should i repost?
You can use Swing in a web application if you are building applets (small java programs that get downloaded and run in the user's browser). Otherwise, your assumption is correct.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: Enabling dynamic hyperlinks
|
|
|