• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Is it wise to develop websites using Java Servlets/JSTL  RSS feed

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Been using PHP to develop Website that require access to either Oracle or MySQL databases. It's easy and a lot of Internet Service Provider support PHP/MySQL platforms, yet not so many support Java Servlets.
I prefer Java and always wanted to migrate to my website development Servlets/JSTL.
Is this a wise decision? Is there a better combination of software apps to develop website using JAVA?

Most site I help develop with are not mobile sites, usually used by mid-sized companies for administration/inventory using MySQL.
 
Bartender
Posts: 20562
120
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are several different approaches to webapp design in Java. In general, however, you should strive for the Model/View/Controller approach. It makes life a lot simpler and it makes both design and maintenance cheaper.

PHP, is, unfortunately, not the best background for learning that. PHP traditionally has embedded the Controller logic and Models directly in the View (php page), or fudged it by having display PHP pages (view templates) connected to non-display (logic) PHP pages.

In Java, the languages for View templates (JSPs and such) is completely different than the language for the Controllers and Models (java). Each is more directly suited to the task at hand instead of trying to be everything to everybody.

Incidentally, JSPs were a "relatively" late addition to J2EE. Originally all you had was servlets and they had to generate the response HTML in its entirety. Those were grim times.

Now you can use JSPs as View Templates and servlets as your Controllers. JSTL is optional, but avoid JSTL that puts application logic onto the JSP, and in particular, don't access databases directly from the JSP.

OR

You can use the Apache Struts framework, augmenting JSP page templates with custom Struts tags, using the Struts servlet to dispatch to action classes.

OR

You can use JavaServer Faces with xhtml View Templates (these are not JSPs!), the FacesServlet, and write POJO Model/business logic classes. JSF is part of the JEE standard. In JSF you don't write Controllers, since they come pre-written in the form of the FacesServlet and JSF tag implementations.

OR

You can use the Spring MVC framework, which is quite popular around here.

OR

You can use a third-party framework such as Wicket, which uses extended HTML for View templates.

OR

You can use a more exotic framework such as Cocoon, which works using XML workflows - although I haven't heard much about Cocoon lately.

And these are just the ones that come to mind for me at the moment.

Again, Model/View/Controller is preferable. JSF is virtually 100% pure MVC, Struts uses an incomplete form known as Model2, and I can't speak for the other frameworks offhand. And if you're one of those who chooses to build/debug/maintain/support your own framework from scratch, it's up to you.

Also, you said "web sites", so this is what I recommend for apps that are primarily into data entry and display. If you'd asked about messaging or web services webapps, I'd give a different answer.

 
Mike Parish
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow! Thanks. Servlets/JSP is probably the method I'll use. I have some experience with them.

Some PHP developers tried to convince me that MVC architecture was possible. I never bought it.

I use Java, (a lot of Lists & ArrayLists), to work on the database. Much more efficient to bundle the return data.

My only other concern is finding a Web Host that will support an Website using JAVA Servlet / JSP at a reasonable cost. I have to sell this to my clients.
 
Saloon Keeper
Posts: 5328
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
$20 per month will get you decent shared hosting with a private JVM running Tomcat. That shouldn't be much of an impediment.
 
Sheriff
Posts: 21689
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also check out Amazon's AWS, you can get a lot for a reasonable price there.
 
Crusading Chameleon likes the size of this ad:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!