Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Actually I have a Java application running on a Linux server as daemon. Now I'll provide a simple web-based configuration page. I have no clue how to solve this without using big frameworks.
What I fell that I don't want is to use Java EE or sth like this. A "small" free (for commercial use) library is ok.
Any ideas?
I would recommend you to use Jetty(it is probably most Java lightweight server) with pure Servlets and JSP. If you need only one or two pages with few configuration options then any framework seem to me like unnessecary overkill.
I can recommend play framework if you want to stay in the java space or if you are adventurous you might consider any number of microframeworks/environments in other languages.
flask(python)
scalatra(scala)
meteor.js(javascript)
node.js(javascript)
twisted(python)
sinatra(ruby)
All of these offer very lightweight web servers(Often allowing you to create dynamic web content in just a few lines) in conjunction with languages that have os integration that will allow you to manage the configuration and status of your application.
You can use Apache Tomcat or Jetty.
Look into com.sun.net.httpserver if you are using the jre. It's already there any very easy the embed.
For configurations you can also use JMX. The jconsole can easily access your application and there is also a JMX HTTP adapter. This adapter allows you to monitor the setting and also change them. This gives you a web page for free but of course its not a "pretty" page.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm thinking about writing a desktop application that the GUI is made with either HTML or PHP, but the functions are run by a separate Java or python code, is there any heads up that I can look into?
There are a couple of possible options:
Run your backend code as an embedded HTTP-server (like Jetty* for Java or Tornado* for Python). If the user starts the application, the backend runs the server and automatically starts the web browser with the URL of your server. This, however, may cause problems with the operating system firewall (running a server on the local machine)
You could also have a look at CEF (chromium embedded framework). It is made for exactly this purpose (running an HTML-Application inside your code). It uses the same codebase as the chromium (and chrome) web browser. It was developed originally for C++, but there is also a Java binding: java-cef
Oh and by the way, PHP is a server-side language. I would not recommend to use it in your scenario (since your backend code is Python or Java).
*I have not enough reputation to add more than two links, so you'll have to google those ones yourself.
You could expose data from Java or Python as JSON via GET request and use PHP to access it. There are multiple libraries for each of these languages both for writing and reading JSON. GET request can take parameters if needed.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I'd like to designing new web application with few requirements and considering which language/framework I should choose.
Requirements:
Web based solution (web UI and backed)
Fast deployment and setup <- by this I mean just run by single command,
no configuration needed for total beginner. Similar to
Jenkins
java -jar jenkins.war
or Gerrit.
Some kind of que to run tasks asynchronously.
No code protection
Due to the fact that I want to be simple to run and deploy (without initial configuration needed) I am considering using Java EE/Spring framework.
Initially I was considering Django or RoR since deploy is pretty easy and development is way faster than Java but those
frameworks need some kind of scheduling framework like Celery + some kind of broker so additional configuration is needed.
I am not limited to any language,(besides PHP since I just do not like it :P)
If any of you have any thoughts about my design and want to share let's do it.
Thanks a lot for any kind of question/ answers.
It is a very open question and there is really no right answer for it. Rails is really great framework for web development, there are gems basically for everything but deployment is not as straightforward as java -jar and also it does not shine that much when you have SPA on the frontend.
If you're planning to build Single Page Application with one of the modern frameworks you may want to consider Spring Boot. Main benefits:
very ops friendly (java -jar), metrics, health checks
whole application config just in one file
great MVC framework for exposing REST endpoints
implementing tasks running in background is trivial.
few programming languages to choose from: Java, Groovy, Kotlin.
Grails 3 looks also promising but since I haven't used it yet I can only suggest having a look.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Is it possible to use Java instead of PHP with Linux, Apache and MySQL?
the 'LAMP' stack is not some special thing, only that there is a lot of support in the form or frameworks etc based on it. There is no problem to create an application based on Linux, Apache, MySQL and Java (LAMJ) but it will have totally different benefits and drawbacks than LAMP because Java is so totally different from PHP.
Where MySQL used to be the database of choice for Java developers I believe that has now shifted towards PostgreSQL. Some folk like NoSQL databases like MongoDB but that really ties into the Java frameworks you want to use. Also you need some sort of web container to run your Java web application in. The most popular is still a web server like Tomcat I think, you could also use Jetty. For larger projects requiring more extensive application management support and clustering you could consider Glassfish or JBoss.
Maybe you should consider an LTPJ stack (Linux Tomcat PostgreSQL Java). I think that will give you more joy in the way of community support.
EDIT: 2019 update. In my perception the 'standard' has shifted to Spring Boot, with which you can run a web application as a standalone jar using an embedded Tomcat instance. Spring Boot offers a lot of out of the box support like Spring Actuator for management endpoints (e.g. application health).
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I've always been a backend C/C++ developer. Working on a Java project (Netbeans), and I am trying to figure out how to do the front-end/UI. While I am a pretty good back-end dev, I haven't really been keeping up with the latest and greatest in frameworks, etc. for the front-end.
The Java back-end component can communicate with JSON over websockets. I am trying to figure out what front-end framework I should use. I also don't want to recreate my project, and would just like to add to my current Maven web application project.
So what's the verdict? What's hip and cool these days? HTML5? JQueryUI? (are they even mutually exclusive?)
Should also mention that I just want to make a quick UI, b/c I am planning on handing off the task to another programmer for a "proper" front-end component later on. At the same time, I do want my version to be "decent". So, in a nutshell, I want something that is easy to use, but still capable.
Thanks!
Assuming this a web app, Angular is getting popular and Bootstrap has been popular for a while. Use pre-built templates you can find for free or at a site like http://themeforest.net . Don't waste your time trying to code your own, unless its super simple.
You probably want to also think about how the backend will communicate with the front if you haven't already. For example, will it use Servlets, or a framework like Spring Roo? You can also build the front in a completely different language, like PHP, as PHP outsourcing is cheaper and easier to find than Java . PHP is a server side language like Java, but I'm talking about a situation where the website's backend communicates with the java backend via an API or sharing a DB. PHP has many MVC frameworks such as Symfony and Laravel.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I choose java to make my web application with maven + hibernate + spring MVC + apache tomcat server (Java EE).
My web application will have many users and many visitors every day.
But my friend told me that web application with java don't support a lot of connections and it's made just for Intranet and business application with network within an organization.
So is it true apache tomcat can't handle all that traffic ?
i'm not looking for who is the best between java, php and .NET i want just know if web application with java can handle a big traffic ?
also explain me if there is some other negative points of using java and apache tomcat server.
The Java based technology stack you describe is extremely scalable, if you want it to be, and I would have no worries about using it for high traffic applications.
You may want to look at distributed hosting and load balancing, to make things more reliable. Lots of high traffic applications use Java and Spring stacks.
using plain old jsp/servlets are faster than spring and hibernate because spring or hibernate have a middle tier with classes which renders the page slowly and takes more memory at the server.
For production environs with huge scale applications you will end up writing plain jsp/servlets as they are a breeze to write and maintain.
Also i would like to add that struts library(jar file) had some security vulnerabilities in late 2013 only. Stay away from Struts and Spring.
People may be down voting but there is truth behind what i have actually experienced.