d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Help Regarding Jsp/servlet Structure
Add Reply New Topic New Poll
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Dec 11 2014 04:13am
I am working on my final project for my web class.

Project is basically:


Imagine a simplistic 'google' page....it has a text input and a button ("search")

The input is a keyword to a keyword-mapped SQL table (but that is another story...)

Anyways, I was thinking of doing something like
  • 1: Have a homepage jsp
  • 2: The search button is nested under a form which calls a servlet
  • 3: Servlet parses keyword string, does sql queries, stores the info I need into some java bean classes. I then redirect back to the homepage jsp
  • 4: On the homepage jsp, I have a scriptlet which checks if the beans are NULL....if not, it displays them

This way, I only need2jsp and 1 servlet

Does this seem okay? Anyone got tips?
Member
Posts: 8,852
Joined: Oct 25 2006
Gold: 4,972.50
Dec 17 2014 09:04am
Sounds good, simple and functional. But don't forget to:
  • Check if the keyword string was empty after the user hits the search button to avoid parse errors or empty params being sent to SQL query;
  • Display some message if the search result of given keyword is empty.
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Dec 18 2014 02:13am
Quote (ZergOwnZ @ Dec 17 2014 10:04am)
Sounds good, simple and functional. But don't forget to:
  • Check if the keyword string was empty after the user hits the search button to avoid parse errors or empty params being sent to SQL query;
  • Display some message if the search result of given keyword is empty.


Yeah, I eventually did all of that.

If no results were returned, I set queries (my list of objects) to NULL and did a check in the jsp. Did a "no results found" dealio.

Couldn't make the css terribly pretty. I tried my best but anything beyond simple stuff like adding borders and absolute positioning is still foreign to me ><

This post was edited by Eep on Dec 18 2014 02:13am
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 18 2014 05:07am
Quote (Eep @ Dec 18 2014 03:13am)
Yeah, I eventually did all of that.

If no results were returned, I set queries (my list of objects) to NULL and did a check in the jsp. Did a "no results found" dealio.

Couldn't make the css terribly pretty. I tried my best but anything beyond simple stuff like adding borders and absolute positioning is still foreign to me ><


look into twitter bootstrap. they have a lot of themes and such which make things look pretty out of the box. i only looked briefly into it since i dont do much css, but coworkers swear by it.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll