This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • 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
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Web based application

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I've played with java some but not really much within the last few years so I am rusty on some things. What I am trying to do is create a web based java application and I am trying to get some direction on how to go about doing this.

By web based application, I am specifically referring to a java application that exists within a web browser and contains GUI elements that can be interacted with. Not sure if that's what everyone else means when they use the term web based java application though.

Not looking for someone to give me step by step as I can look that up on my own but rather I am looking for a general direction as there seem to be different java tools or technology I can use but I am trying to use the most common one, so with that said....

I know there are some older java technology for creating GUI elements such as Swing but from what I have read it seems this is just for standalone java applications? Same for JSF (faces)? Is the best solution that I create an applet?

Please let me know if what I am asking even makes sense. As mentioned it's been a little while since I've dabbled with java and that can feel like an eternity so it's possible in my question I am making flawed assumptions.
Basically I want to create a java application that lives in a web browser and this application can contain java GUI elements such as buttons, text fields, drop down menus, etc.
What would be the direction I need to look in technology wise to do this, in the most common way possible. I added that last bit because I am sure there are probably many ways to do this but for my purposes I need to do it in the most standard, common way, regardless of if there are better, less-commonly used ways to do this.
 
author & internet detective
Posts: 39789
797
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harry,
Java is moving away from running in a browser. That used to happen via applets. Now browsers are discontinuing applet support.

What's the reason you want to use Java for the front end rather than HTML/CSS?JavaScript?
 
Saloon Keeper
Posts: 21603
147
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java there are two different places where a web application can exist - on the webapp server and/or in the browser. For Java code to execute in a browser, however, you have to create an applet, and after the major security problems in applets several years back, applets should be considered dead technology. You can put web application code in the browser using JavaScript and there are a number of JavaScript-based frameworks to help with that, including REACT and jQuery.

However, in most cases you're going to need a web application server to serve up the initial pages and very often also to reference a server-side database or other backend systems. So for simplicity's sake in the Java world, your best bet is to start out using JSP's and servlets, learning how to build and deploy WARs.

And please do not succumb to the temptation to code in scriptlets just because they look like browser-side coding. They aren't, and they're murder to debug. Do your serious programming in servlets and use the JSP's as web page templates.
 
Harry Wordsworth
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne and Tim thanks. So it looks like Applets are what people have used in the past but that technology is dead now. I did find what I thought was an alternative in "Java Web Start" but it looks like that is used to launch a java application from a web browser instead of interacting with a java application "in" a web browser. I can't use JavaScript for my purposes as it has to be java. Basically this is just for testing purposes and I have to use the common method people have used in the past to achieve this functionality.
 
Jeanne Boyarsky
author & internet detective
Posts: 39789
797
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that Java Web Start is not included in Java 11+. Oracle isn't encouraging this direction.
 
Blood pressure normal? What do I change to get "magnificent"? Maybe this tiny ad?
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!