• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enabling dynamic hyperlinks

 
Adewale Adebusoye
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Adewale Adebusoye
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In which case you have posted this in the wrong forum. I'm assuming you are using Swing?
 
Adewale Adebusoye
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic