Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet or JSP? (or other?)  RSS feed

 
Zach Fredrickson
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey folks,

For my Capstone Project at school I am creating a web page to reserve tennis courts online. I'm trying to decide what to used as a go between from the database to the web page. From what I understand about JSP, it would be optimal for creating dynamic content inside of a web page. I also understand it's quite complicated and somewhat larger scale than I really need to be for a school project.

I plan to used JavaScript and MySQL and need something to make them play nice. What is the quickest, easiest way to do this? Does anyone have any suggestions?
I'd like to complete the project in the next two weeks and I don't know PHP but I do know some Perl.

Thanks for the help,

Zach
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You did not mention your proficiency with Java. Modern JSP can be quite simple actually because all of the Java code is in Java classes, and not in the JSPs.

So if you are already pretty good with Java, there are only a handful of concepts (JSTL and EL, in particular) that you need to wrap your head around to make leeway with simple pages.

Two weeks is a rather aggressive schedule for any new technology.

Another possibility is to do everything via Ajax from HTML pages, but that's far from optimal -- a mix of JSP and Ajax is usually the sweet spot.
 
Zach Fredrickson
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two weeks is a rather aggressive schedule for any new technology.

That's how long it took me to learn enough Java to pass the SCJP6

Another possibility is to do everything via Ajax from HTML pages

This is what was originally suggested to me and it seems, when I was looking into it, that AJAX really just means JavaScript. Honestly, and I know this is off topic, but if you could clear this up I'd be eternally grateful, does "AJAX" use XML to talk to the database and if so, HOW? Every example I've seen uses ASP or PHP. It occured to me that if you could use ASP you could proabably use JSP and I know much more Java than VB, but from what I know about JSP wouldn't that eliminate the need for the XML part of AJAX? I suppose it's all in how you use it, but that's kind of where my question was directed in the first place. Is using AJAX and JSP an optimal solution for this small project, or should I look elsewhere? (Perl has some AJAX-like modules but that just looks complicated...)

Also, if this is the way to go, could you give me some links to good info about EL and JSTL?

Thanks,

Zach
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajax is a means to make requests back to the server without submitting the whole page. It's perfect for fetching small HTML fragments and stuffing them into an existing page.

XML can be returned as the response, but that's actually rare. Usually it's used to return an HTML fragment, or data in JSON format.

Ajax could care less what you do on the server (PHP, JSP, ASP, Fred's Fabulous Framework, et al). Whatever gets returned as the response is what Ajax gets.

If you are going to go the Ajax route, do yourself a favor and use jQuery to do your Ajax for you.

 
Zach Fredrickson
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK cool. Thanks for the tips.
 
Zach Fredrickson
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are going to go the Ajax route, do yourself a favor and use jQuery to do your Ajax for you.


I guess I'm not one of the cool kids because I took a look at jQuery and I'm confused.

I thought it would be a program of some sort. It's just a JavaScript file... I guess the crucial point I'm missing here is what it's purpose is...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a JavaScript library.

It will reduce the amount of code you have to write to perform an Ajax request by something like a 20:1 margin.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Zach Fredrickson wrote:For my Capstone Project at school [...] I'd like to complete the project in the next two weeks [...]

I thought capstone projects were supposed to be in-depth, intensive projects to demonstrate mastery of a comprehensive set of materials.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!