File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes A beginner question - JSP and Servlets - when to use and when not to use ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "A beginner question - JSP and Servlets - when to use and when not to use ?" Watch "A beginner question - JSP and Servlets - when to use and when not to use ?" New topic
Author

A beginner question - JSP and Servlets - when to use and when not to use ?

Andy Jack
Ranch Hand

Joined: Nov 22, 2012
Posts: 257
If I want to create a website like this forum would JSP and Servlets be good for the job ? Should I use something else ? How do i decide if JSP and Servlets are the right tool for the problem at hand ?
Please advise.


Java Newbie with 72% in OCJP/SCJP - Super Confused Jobless Programmer.
I am a "newbie" too. Please verify my answers before you accept them.
Raghvendra Pratap Singh
Greenhorn

Joined: Jul 26, 2012
Posts: 22

If I want to create a website like this forum would JSP and Servlets be good for the job ? Should I use something else ? How do i decide if JSP and Servlets are the right tool for the problem at hand ?
Please advise.


I think if you are planning a website like this forum where you need complete MVC architecture , you need database connectivity, you need authentication, you need security of your data so i willl advise you that you should use some framework like Spring with hibernate, Only JSP and Servlet will not be sufficient without any framework. Also management of your code will be easy if you will use any framework.


Thanks and Regards, Raghvendra Pratap Singh
"Quality means doing it right when no one is looking"
J. Kevin Robbins
Bartender

Joined: Dec 16, 2010
Posts: 1070
    
  13

I must respectfully disagree. I'm of the opinion that beginners should not use frameworks until they have a thorough understanding of exactly what that framework is doing for them. Otherwise they end up using the framework as a crutch and they don't even understand the resulting code.

The OP would be better served to learn to write a MVC application using servlet controllers, DAO's, and DTO's, before even cracking a book on Spring or Hibernate.

The only exception to this rule that I would support would be using the jQuery framework to assist in writing Javascript.

That's just my two cents worth...


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Andy Jack
Ranch Hand

Joined: Nov 22, 2012
Posts: 257
Jk Robbins wrote:I must respectfully disagree. I'm of the opinion that beginners should not use frameworks until they have a thorough understanding of exactly what that framework is doing for them. Otherwise they end up using the framework as a crutch and they don't even understand the resulting code.

The OP would be better served to learn to write a MVC application using servlet controllers, DAO's, and DTO's, before even cracking a book on Spring or Hibernate.

The only exception to this rule that I would support would be using the jQuery framework to assist in writing Javascript.

That's just my two cents worth...


Yeah. Bear also used to tell me that JSP and Servlets are important.
Hikari Shidou
Ranch Hand

Joined: Jan 22, 2013
Posts: 88
I suggest you to just use a CMS. It's not worthy developing a new software when there are so many many forum engines out there.

Just search for them, test them to see which has the features you want, and take a look on their license to be sure you can use them.

If there's some feature they don't have and you need, you'll just have to learn their API and develop plugin.
Andy Jack
Ranch Hand

Joined: Nov 22, 2012
Posts: 257
Hikari Shidou wrote:I suggest you to just use a CMS. It's not worthy developing a new software when there are so many many forum engines out there.

Just search for them, test them to see which has the features you want, and take a look on their license to be sure you can use them.

If there's some feature they don't have and you need, you'll just have to learn their API and develop plugin.


No, i wanted to learn the nuts and bolts of software development. I don't want to make a new forum for others. As you mentioned, there are plenty of tools for that already.
Hikari Shidou
Ranch Hand

Joined: Jan 22, 2013
Posts: 88
Well in that case, for sure Servlet+JSP is adequate.

But PHP has advantages that makes it better IMO
Andy Jack
Ranch Hand

Joined: Nov 22, 2012
Posts: 257
Hikari Shidou wrote:Well in that case, for sure Servlet+JSP is adequate.

But PHP has advantages that makes it better IMO


Why do you say that PHP makes it better ? What does PHP do for me that JSP and Servlets cannot ?

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

It'd be best to ask about PHP in a new topic in the PHP forum, unless you would like this post moved to the PHP forum?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Hikari Shidou
Ranch Hand

Joined: Jan 22, 2013
Posts: 88
No need to move. He asked if Servlet is adequate and I cited PHP as alternative, that's all.

Answering the question, it's the contrary, pratically everything we can do in PHP we can do better with Java+Servlet+JSP. The only thing PHP can do and Servlet can't, is run each pageload on different unix user. That's great for shared hosting. For simple web apps that don't receive many hits, it's also good that the whole app is loaded on every (rare) pageload and frees all resources after, but once web app gets more complex and receives hits, that's a big trouble that makes hard for PHP to scale.

In the case of a web app that basically loads/stores data in DB and builds HTML documents, PHP is better because it requires less code to get things done. Java requires creating beans (in PHP just use arrays and add them anything on the run), use MVC, it's DAMN hard to test (deploy, stop tomcat, delete folder, start tomcat, reload... in PHP you just edit the file directly inside hosting folder [files of course managed by SVN and commited all the time], reload and it's there, with session still working!). PHP has a lot of built-in features that Java requires external libs, etc.

If the web app has little business logic to put in controller, MVC becomes a burden, and PHP is way way better than JSP.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A beginner question - JSP and Servlets - when to use and when not to use ?