• 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
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Javascript or JSF for web based application with Oracle Database

 
Bilal Ghayad
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello;

I need to create an application that will be used for telecom operator, the database will be oracle but it is required to be web based application.
So really I am thinking if to use JSF or Vaadin or to use javascript with Python? My initial idea that javascript is giving more flexibility special if we used python for server side code where javascript will be used for client side development and will call python methods using APIs. But of course JSF is also strong and Java code has a lot of functionalities. If I was need to create a desktop application, for sure I will use java swing or javafx and will not look for python or javascript, but because the application needs to be web based, so I am confused what to use.

Also, if using javascript is the recommended option for my case, then is it recommended to use python for server code or to use java code (just for server side)?

Appreciate the kindly advise and help.
Regards
Bilal
 
Bear Bibeault
Marshal
Posts: 67279
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You haven't given us much to go on regarding selection criteria. There are many choices, much more than you've listed, for creating web applications. What's important to you?
 
Tim Holloway
Bartender
Posts: 20980
128
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Bear as said, there are many more options than these.

However, in regard to basic platforms, Java is more secure and generally more performant and has, I think, more options than Python. Python will make you look more productive, but at a cost. For quick-and-dirty in-house and some non-critical general internet needs, I have no problem with Python (and especially with django) - or with node JS, but for industrial-grade systems and stuff where you don't want to be the point where hackers break in, the extra work required for Java is worth the results.

JSF is not incompatible with JavaScript. In fact, JSF Version 2 is dependent on internal JavaScript to handle its AJAX functions. Some add-on tag sets such as RichFaces and IceFaces ever incorporate jQuery into their controls.
 
Jan Daermann
Greenhorn
Posts: 28
1
MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keeping in mind that there might be a multitude of UX required (html, IOS, Android, yadayada) it might make sense to establish a REST Server and program the frontend any which way you want.
 
Bilal Ghayad
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

but for industrial-grade systems and stuff where you don't want to be the point where hackers break in



Yes this is what I need.

What other options that are available for industrial-grade?

By the way, when you were talking about using JSF, do you mean this to be used for front end and server side or only for server side? Because I am worry in case of using JSF, we will have a poor control at the look design or at the client side coding. So that is why I was thinking in JavaScript. I do not know how much JSF will have the capabilities of the JavaScript at the client side, appreciate the advise please.

For the time being, the client will be using the computer and the browser. But for future, maybe we will need to add client for mobile (android and IOS).

Thanks for the kindly reply and appreciate the help and kindly advise.
Regards
Bilal
 
Tim Holloway
Bartender
Posts: 20980
128
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Languages I don't consider "industrial grade" for the web:

1. Anything interpreted and loosely typed (javascript, PHP, python).
2. Anything that doesn't police itself well enough to avoid programmer accidents such as array overflows, faulty type-casting, and pointer errors. That includes C/C++. While ideally programmers would be meticulous enough not to require hand-holding, the currently prevailing "git 'er dun!"/whatever's cheapest management approach means that nobody ain't got time for that and besides I'm not paid enough to do all that.

So what's left? Virtually nobody writes webapps in COBOL. You don't see many positions advertised looking for Ada web skills. Maybe go would work, but it doesn't have as large an established base as the most-popular languages.

So I'm kind of left with Java by default.

Java ServerFaces is a Model/View/Controller system. Its only real function is to manage the GUI, which it does by transferring data back and forth from the client and server and by validating data supplied from the client - when the server gets an action command it can rest assured that the model data that the action method will work on reflects exactly what the client entered and that that data has 100% passed all validity checks.

The core JSF GUI tags (the "h" tagset) are just thin wrappers over stock HTML, and thus have the same basic limitations as raw HTML does - although even raw HTML supports CSS and javascript. However, there are a number of third-party tagsets that provide smarter controls such as column-sortable/filtered table displays, true dropdown combo boxes (HTML has only dropdown without text entry), Google maps, 2-column item pickers, spinners and much more. And if you don't find that sufficient, you can design your own custom tags. You can also use jQuery with JSF, although jQuery GUI controls might require a little extra help to incorporate themselves into the JSF Model/View/Controller automated data cycle. Many of these extended tags do their client-side magic using "invisible" JavaScript that's generated by the JSF tag renderer.

JSF works best for data entry and display. It is not suited for things like ReST, which are not display-oriented. However, JSF is also not greedy, so I have written apps that use JSF, ReST, and even Spring MVC all in the same webapp.
 
Bilal Ghayad
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you a lot for the kindly advise and help and directing me.

And if you don't find that sufficient, you can design your own custom tags.



This own custom tags need to be designed using HTML and JavaScript and then can be added in JSF?

What is the recommended framework to be used for REST?
Why not to use Javascript and jQuery for client side coding with REST methods to be called at Java code for the server side? Or JSF has more advantages than this model?

From the other side, what about Vaadin?

Regards
Bilal
 
Tim Holloway
Bartender
Posts: 20980
128
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Vaadin, I'm totally ignorant. JSF, incidentally, is part of the JEE standard specification, so it's pre-installed on compliant full-stack webapp servers (Tomcat and Jetty are not full-stack, but you can include JSF JARs in webapps).

The advantage to JSF is that you don't do as much coding. JSF is primarily declarative, and declarative has several advantages, although it isn't as flexible as full programming. I often say that if you're using any classes in the javax.faces package set other than the Model helper classes, then you're probably doing JSF wrong. Which is a bit over-simplified, but only a bit.

There's an Apache ReST support library, but I'm afraid I don't remember its name. ReST is primarily useful for 2 situations: 1) when you want to present web services or 2) when you are willing to do more client-side coding in order to achieve scalability.  JSF is when you don't want to write/debug/maintain a lot of code, but you want to do data entry and display. JSF avoids the issue of writing code to input and output web page (View) data, because it's MVC-based. Also, unlike many MVC systems, you don't have to write your own Controllers, since the JSF FacesServlet and tag libraries do all the Controller operations. So you only have to code Models (Backing Beans) and Views (xhtml templates). Likewise, most of data  validation functionality consists of simple attribute definitions on the View Template, so you don't have to write code to do routine validations or report invalid data. For more complex checking, you can create your own validators, but your validators only have to actually check the data and throw an exception if the data fails. The built-in error handlers do the rest.

For creating custom controls these days you have 2 options in JSF. One - and the one I recommend for most purposes - is done by coding XML to define the control. For more esoteric functions, you can also code custom tags as binary components (and package them into JARs, if you want). A binary component is much more complex to create, and more likely to end up having to be re-designed should JSF undergo major internal re-design, as it did from JSF version 1 to JSF version 2.


My personal opinion on client-side logic is that yes, you can make apps that are more scalable that way. But JavaScript is a loosely-typed interpreted language, and remember what I said about that. Also, if something goes wrong, you generally can't look at the server logs to find out what happened, since what happened likely happened on the client-side. Meaning you have to depend on the user to give you useful information. Good luck with that.

Which isn't to say that I'm totally against something like React/ReST, but I'd want a really compelling reason to go that route. I recently tried to work with a system like that (only the backend used a complex PHP framework), and I just finally had to give up. And I never give up on a technical challenge. But without more help from the client, I just couldn't justify the work it would take to resolve their issues. With server-side apps, I can monitor and control the whole process or at least most of the annoying parts.
 
Ron McLeod
Saloon Keeper
Posts: 2679
335
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are thinking of using JSF, take a look at PrimeFaces - it is open source and contains are very large set of nice-looking components.  The showcase pages gives good examples of the markup and associated Java code for each widget.
 
Bilal Ghayad
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for all of you.

So if I need to use JavaScript with ReST methods, then the recommended to use java code with Apache ReST for the server code? Of course if the server side is java code, then I can use Sprint, maven and other Java frameworks.
I understand why the discussion was recommending JSF more than JavaScript with ReST method model, but again I am trying to compare between these two model (JSF or JavaScript with ReST methods at client side and java code with Apache ReST framework at server side).

One more thing: Is there better model than JSF or JavaScript for web app development for Industrial sector (Database is oracle, Google map needs to be used, sophisticated reports, … etc)?

Regards
Bilal
 
Howard Hyde
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don’t know JSF, but I am expert in Oracle and am working on an updated edition of my 2012 book “Java Web Database Application Development” (https://javawebdb.wordpress.com/) which will use SpringBoot, JPA/Hibernate and Thymeleaf. My open-source project at https://github.com/hhyde007/RADSpringBootGen features a complete sample application built this way.
Let me know if any of this is of any value to you.
-Howard
 
Liar, liar, pants on fire! refreshing plug:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!