It's not a secret anymore!*
The moose likes Other Open Source Projects and the fly likes lucene highlighting + jsf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "lucene highlighting + jsf" Watch "lucene highlighting + jsf" New topic
Author

lucene highlighting + jsf

Tommi Vd
Ranch Hand

Joined: Apr 23, 2009
Posts: 49
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
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41155
    
  45

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"?


Ping & DNS - my free Android networking tools app
Tommi Vd
Ranch Hand

Joined: Apr 23, 2009
Posts: 49
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: lucene highlighting + jsf
 
Similar Threads
h:datatable, how multiply row cell A with row cell B and set value in row cell C
Setting up a JSF project with data tables
datatable - row colors
nested h:datatable question
dataTable in JSF