Results 1 to 15 of 15
  1. #1
    teedoff is offline Member
    Join Date
    Jun 2010
    Posts
    1
    Rep Power
    0

    Default search with java?

    Ok I have no java experience. I have a client who wants a search function added to his STATIC site. He does not under any circumstances want to convert to a dynamic site, but is ok with maybe have a dynamic page or two for the sole purpose of a search feature. I already designed a CF search with a quickly created database (which he doesnt have yet) and he didnt like it. The problem is he wants a search function that the user can define...meaning the user types a keyword such as '75 watt", since his site is a light bulb replacement company, and then return the results in a table.

    I hope this is the right forum for this. Can anyone help me with some code for this problem? I would greatly appreciate it! If anyone needs any more details, let me know. Thanks!

  2. #2
    gafa's Avatar
    gafa is offline Senior Member
    Join Date
    Jun 2010
    Posts
    107
    Rep Power
    0

    Default

    you can use the reg expressions to analyze your text =)
    + 1 my REP
    Good Luck :)

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    If your site have those keywords, may be in a database you can make a lookup on to the DB. Or else what you have to do is, search through the static page content. It's not quite possible with Java, you have to go to JSP and so on. In that case site must be in JSP. Is that your site in pure HTML?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    wants a search function added to his STATIC site
    How will any code be executed on a STATIC site? A search implies execution of special purpose code to do the search.
    Does the site have cgi?

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Why cannot do it with static content, I mean with the physical files on the server, which is unusual thing for me. :p

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Perhaps a javascript solution. The JS looks at the user's input and figures out what page on the server to get and sends the request for that page. No code execution on the server.

  7. #7
    gafa's Avatar
    gafa is offline Senior Member
    Join Date
    Jun 2010
    Posts
    107
    Rep Power
    0

    Default

    sure JS can help :)
    + 1 my REP
    Good Luck :)

  8. #8
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default

    Dont you mean Ajax? I fail to see how javascript can accomplish this on its own

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by al_Marshy_1981 View Post
    Dont you mean Ajax? I fail to see how javascript can accomplish this on its own
    I think AJAX is more effective than alone with JS. Using JS also it's possible to done on the client side with that static content. And with AJAX we can deals from the back end as well.

  10. #10
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default

    Quote Originally Posted by Eranga View Post
    I think AJAX is more effective than alone with JS. Using JS also it's possible to done on the client side with that static content. And with AJAX we can deals from the back end as well.
    Yup thinking through it more I think you are right, there is probably no need to go server end with a small site that wont change much. Javascript will do the job.

  11. #11
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Accessing the server is not an effective way at all, so we must do that only if it's really needed to do the job. Specially I'm working with web applications, trying to implement lots of features on the client side.

  12. #12
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default

    Quote Originally Posted by Eranga View Post
    Accessing the server is not an effective way at all, so we must do that only if it's really needed to do the job. Specially I'm working with web applications, trying to implement lots of features on the client side.
    what would be a big reason to access the server? In production code.

  13. #13
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    May be simply accessing the database for a portal or something like that, which can be thousands of user involved daily.

  14. #14
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default

    Quote Originally Posted by Eranga View Post
    May be simply accessing the database for a portal or something like that, which can be thousands of user involved daily.
    Alright, thanks for the reply.

  15. #15
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Binary search tree search method
    By chopo1980 in forum New To Java
    Replies: 2
    Last Post: 12-10-2009, 01:42 AM
  2. Replies: 0
    Last Post: 10-29-2009, 09:28 AM
  3. Replies: 5
    Last Post: 08-26-2008, 03:43 PM
  4. Desktop search in java
    By hellosubs in forum New To Java
    Replies: 0
    Last Post: 06-15-2008, 03:33 PM
  5. Binary Search in Java
    By Java Tip in forum Algorithms
    Replies: 0
    Last Post: 04-15-2008, 07:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •