Go Back   Java Programming Forums > Java EE (Enterprise Edition) > JavaServer Pages: JSP & JSTL


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 30-01-2009, 03:58 PM
Junior Member
 

Join Date: Dec 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Mohd is on a distinguished road
Default How I can highlight keyword search?

When I search by some Keyword

I want display the result and Highlight me keyword for example:

Keyword: Java

"Java" display different from rest text

any way: strong or change color ...etc

my code use <c:forEach to display the result



Reply With Quote Share this thread on Facebook
Sponsored Links
Java Training from DevelopIntelligence
  #2 (permalink)  
Old 30-01-2009, 04:05 PM
JavaPF's Avatar
mmm.. coffee
 
7 Highscores

Join Date: May 2008
Location: United Kingdom
Posts: 1,581
Thanks: 103
Thanked 93 Times in 86 Posts
JavaPF is someone you want to know!JavaPF is someone you want to know!JavaPF is someone you want to know!

I'm feeling Stressed
Default Re: How I can highlight keyword search?

Hello Mohd,

Have you already coded the search function?

You just need to insert HTML tags before and after the keyword.

Java Code
<strong><font color="red">JAVA</font></strong>
If you post your code here then ill see if I can help add it.
__________________
Don't forget to add syntax highlighted code tags around your code: [highlight=Java] code here [/highlight]

Forum Tip: Add to peoples reputation () by clicking the button on their useful posts.
Reply With Quote
  #3 (permalink)  
Old 30-01-2009, 04:59 PM
Junior Member
 

Join Date: Dec 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Mohd is on a distinguished road
Default Re: How I can highlight keyword search?

Java Code
            <c:forEach var="book1" items="${bookList}">
            <tr>
                <td>
                    <c:url var="listThreadsUrl" value="BookDetailsServlet">
   <c:param name="id" value="${book1.id}"/>
  </c:url>

  <a href='<c:out value="${listThreadsUrl}"/>'>
        ${book1.title}
  </a>
            </tr> 
            </c:forEach>
the keyword forward from jsp page to servlet to perform query and finaly to other jsp page
and here display the result

my result is " book1.title "

if you search for Java
may will find "Java How to Program"

Java here should be different
Reply With Quote
  #4 (permalink)  
Old 31-01-2009, 05:34 AM
Junior Member
 

Join Date: Dec 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
vigneswara is on a distinguished road
Default Re: How I can highlight keyword search?

Quote:
Originally Posted by JavaPF View Post
Hello Mohd,

Have you already coded the search function?

You just need to insert HTML tags before and after the keyword.

Java Code
<strong><font color="red">JAVA</font></strong>
If you post your code here then ill see if I can help add it.
in jsp it is possible but how in command prompt
__________________
paruchuri
Reply With Quote
  #5 (permalink)  
Old 01-02-2009, 10:35 AM
Junior Member
 

Join Date: Dec 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Mohd is on a distinguished road
Default Re: How I can highlight keyword search?

There is solution by using javascript

I found this one
Search Engine Keyword Highlight with Javascript | SYP

but I didn't know how to use it in jsp
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Similar Threads
Thread Thread Starter Forum Replies Last Post
Patricia Trie Search javaguy What's Wrong With My Code? 0 21-07-2008 06:54 PM


100 most searched terms
Search Cloud
2d arraylist java actionlistener actionlistener in java actionlistener java addactionlistener addactionlistener in java addactionlistener java applications of oops could not create java virtual machine xp double format java double to int double to int java double to integer in java double to integer java eclipse shortcut keys eclipse tutorial for beginners exception in thread "awt-eventqueue-0" java.lang.outofmemoryerror: java heap space exception in thread "main" java.lang.nullpointerexception exception in thread "main" java.lang.outofmemoryerror: java heap space format double java get mouse position java java 2d arraylist java actionlistener java addactionlistener java convert list to map java double format java double formatting java double to int java double to integer java format double java forum java forums java get mouse position java list to map java mouse position java programming forum java programming forums java programming help java sendkeys java two dimensional arraylist java.lang.classformaterror: truncated class file java.lang.outofmemoryerror: java heap space java.util.arraylist jbutton actionlistener jtextarea font jtextfield font size jxl.read.biff.biffexception: unable to recognize ole stream programming mutators and generics two dimensional arraylist java writing ipod apps

All times are GMT. The time now is 05:57 AM.
Powered by vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.