• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

lucene highlighting + jsf

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm using lucene in my web app.
Now i want to highlight specific terms from my search result and i'm using the datatable with jsf for showing the results.

Now for the higlighting part i'm making a simpleHtmlFormatter:



And in css i give it a background-color yellow.

but in my webpage i get this result:




So the problem is he prints the span instead of taking it as html...

jsp page:




Can anyone help?

kind regards,
Thomas
 
Rancher
Posts: 43015
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Isn't that exactly what the code should output?

How are you applying the CSS - are you sure the stylesheet is found, and that the proper spans are correctly selected by the rule for "highlight"?
 
Tommi Vd
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:
Isn't that exactly what the code should output?

How are you applying the CSS - are you sure the stylesheet is found, and that the proper spans are correctly selected by the rule for "highlight"?




yes its correct output,
BUT the problem is that he shows ch01 <span class="highlight">java</span> in the browser as text...

i put it in the outputText in the table as a property string from result object.
 
It was the best of times. It was the worst of times. It was a tiny ad.
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic