• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Urgent ! Sending text as a Link into database.

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have developed a news application in which a user can post new news with title,description and an image upload.I can approve the news and user then can see the approved news.
Now the problem is if the userputs some link like more on www.bbc.com in description text area,then it goes like a text and get displayed as a text.I want to see the link on approved news page,How should I do that.
Do i need to add a new section in post news to post the links.Also how links will get stored in database.I am using MySQL.
Thanks a lot!
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can store the link in the database as html text, for example:

<a href="http://bbc.com">bbc.com</a>

You can then display it using a <bean:write> tag as long as you specify filter="false". This tells struts not to filter out or escape html tags found in the text.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic