I am looking to develop a java REST web service to work with my android app that I am also developing and I have been trying to look for the best option to host the service and everything I find seems to lead me in a different direction.
Can anyone give me advice on what the best way to host a java REST web service would be? I can do linux or windows and am relatively familiar with the lamp stack and IIS.
Thank you
I would suggest looking at the Google App Engine for hosting, and writing the service in Java. I just set up a few services that way for an app I'm working on and it was fast and easy, and currently it's free of charge for a very generous limited usage.
Exposing REST type access to resources persisted as JPA entities is very straightforward with Play! framework:
http://www.playframework.org
RESTful on Play! framework
Hosting: Heroku ( http://www.heroku.com ) supports Java as a language (as well as Ruby, Node.js, Clojure, Python, and Scala), and Play! as a framework, making it a good candidate in case you are going the Play! route;-) ... though obviously not the only use case.
Development life-cycle: This overview and this tutorial should give you a pretty good feel of the development life-cycle with git and Heroku+Play; if coming from "regular" Java tooling type of environments, you may find this approach refreshing.
IDE integration: Play! has plugins for NetBeans, IntelliJ IDEA and Eclipse ( http://www.playframework.org/documentation/1.2/ide )
So if you are familiar with the lamp stack why not using php for the REST service? Check out zend's REST implementation.
Related
We are using Google App Engine for back-end development. We're considering the scalability, change of server and data movement to another cloud platform in future, as well the robustness in application. Please suggest the frameworks that can be used in Google App Engine (Java based).
End point exposure/Rest web services
ORM/database connection
Service and db layer integration
Logging
Unit testing
etc
Please add any points that I may have missed.
Update: The reason behind asking this question is that when we start development we will get a hell lot of samples, for example:
Rest web services - we have Spring Boot/Spring rest web services
DB - we have JDO, Google Datastore, etc.
For easy access we can use Spring Core.
If we browse through information on Google App Engine Java development, we're unable to find a list of advantages/disadvantages. It's correct that we have many options. While answering please also consider the bolded words. The question definitely looks simple from an angle, but it's a serious issue for the fresh development.
There are several products and services within Google App Engine that will help you out building scalable backends in Java using App Engine. Here are some examples based on what you may be looking for:
Endpoints Frameworks on App Engine in Java - helps with developing, deploying and managing APIs on any Google Cloud backend.
Objectify - a Java data access API, specifically designed for the GAE datastore.
Stackdriver logging - provides facilities for importing, viewing, storing and retrieving timestamped logs from apps running in GCP.
Unit Testing in Java - which allows you to test the quality of your code after you’ve written it, as well as to improve your development process as you go along.
UPDATE: This article on Designing for Scale is a good place to start for best practices on scalability in App Engine. Regarding robustness, that’s a given using App Engine, as it is designed as a robust development environment for written applications. If you’re considering moving to another cloud platform in future, take a look at the GCP documentation on exporting data for each specific product you wish to export from.
You may find these articles on Spring Framework useful, which focus on the benefits and best practices.
Announcing Spring Cloud GCP—integrating your favorite Java framework with Google Cloud
Optimizing Spring Framework for App Engine Applications
I just develop a tool with my classmates and we want to use Vue.js as Web interface.
For Description what we programmed. We developed a Java EE web application in Eclipse. We use Tomcat 7 as web server. I search a long time and i found nothing.
Vue.js is a javascript front-end framework. There is nothing to stop you from using that with a middle-layer/back-end technology like Java EE.
In your HTML pages(or JSP) just include the Vue.js file as mentioned in the documentation, and other .js files that you create as part of your vue.js frontend application.
The library can then interface with any HTTP-based backend methods that you expose (using Servlets, Controllers, etc.) depending on how your Java EE project is structured and what frameworks it uses.
While investigating the same question, I found this good blog that has a git repository too
https://blog.codecentric.de/en/2018/04/spring-boot-vuejs/
From a glance it looks like a read solid implementation, however it has some sticky setup i haven't come across before.
It dose however seem like a professional and scalable solution i will definitely
give a try.
https://github.com/jonashackt/spring-boot-vuejs
Thankyou 04/24/18 by Jonas Hecht
For sure you can.
Your java application, which is your "backend", has to expose its functionalities as Web services (REST Json WS should be the easiest for what you are trying to do).
To expose your services as Web services, you need to find the easiest framework fitting your need. You will probably need to dive into Maven if you haven't yet, because these frameworks tend to have tons of dependencies.
Your Vue.js interface will make calls to the backend via HTTP requests each time necessary (get a resource, update a resource, ...).
I have always been a front-end Java programmer, sometimes had to do C# on .NET but for the most part, Java is probably all I know about.
Just currently I have to do a small-scale website doing extremely simple thing and I really don't know where to start. My HTML skill is probably as good as I am with XML on Android, which is fair to say far less complicated than the HTML source code modern website have. I have almost no experience with PHP either, and no strong background on building or managing a database.
Is there some sort of technology that builds fully working website using mainly Java? It may have other languages I have to familiarize with but for the most part, I'd like to have little learning curve. For the backend I'm very sure I'm going to use cloud server services like Azure or Parse.
This is a very special project of me so I can't let anyone code it rather than me and myself only. Thank you and have a good day.
Use Servlets and JSPs for web development it's a start point and then java webservices as you already know XML.
I suggest you to build all your front-end using the following set of technologies: HTML5, AngularJS, JQuery, javascript, bootstrap. Your backend could exchange json with the front-end. The Bootstrap is the base for all your website and you could get a free template from the web itself, which would severely reduce your hard work at web designing. You would need just to adapt the links and calls, and the AngularJS would handle the controller and other stuffs ( have a chance to learn about ). Some JQuery components, or even AngularJS components would enhance your system usability and combined with javascript would bring most of hard work to front-end. I had the chance do start a system from zero and this is what I did, and now I have an AngularJS app working together with java by having java on the backend ( spring, hibernate, etc ) receiving and providing json data. At github you find some angularjs seed examples which you could use in your app and, again, save time and effort.
My apologies in advance, My answer is a bit broader in scope,
The Best Development Model for developing any website regardless of your language choice in Azure App Service is to take advantage two powerful features offered by Azure App Service, the Continuous Deployment feature and Deployment slots.
Start your website on a git repository and you may have node modules or bower packages, but on build your git will crunch it down to a working website with proper gulp files. Check out this blog to understand the process.
Once you have the git repo working for a simple website, your development process becomes much smoother. You can commit a change and Continuous deployment will automatically start a deployment for you to get your latest bits into your web app.. Check this blog for more details on Continuous Deployment.
You can use deployment slots to stage your changes and swap to maintain multiple versions of your web app on the cloud to easily build a production level application that has a last known good state. Check this blog for more details on Deployment slots.
The two features are the most used features while developing, deploying and servicing any project I work and I have found them very useful to understand them and use them in all their glory.
I am not a Java developer, but from the your question I can see you are looking to start on web development, the quick and powerful way (purely subjective here :D) is to use Asp.Net 5 with Angular 2 Beta. Here is an end to end tutorial on how to setup a development environment. Asp.Net 5 should be friendly toward Java developers as it is very light weight and simple to use and works great with vscode and visual studio community edition.
Let me know if the long answer helped, if you need a pure java environment that should be possible too :).
Friends,
Your technology stack is the rope that will save you or hang you. For a one man webservice startup - what kind of rope is this list?
Plattform: Google App Engine, Backend: Google App Engine Datastore, Servicelayer: Java,
Frontend: Adobe Flex
Client/Service integration framework: GraniteDS, Client Application Framework: Tide (Part of the GraniteDS stack), Service Application Framework: Spring
Ok, let me give you my context.
Flextras is right! Technology is mostly chosen because of knowledge/infrastructure ... This is how I ended up with the list given above:
First of all: FLEX appeals to me. It’s easy to build rich UIs and Adobe is pushing it in the direction Desktop, web and devices. Adobe marketing gives us the promise: ”Integrate with the other tools in the creative suite” and ”Deploy everywhere”. (Of course it’s too good to be true, but they seem to be on the right track.) So lets choose FLEX as our UI framework.
FLEX often must integrate with serverside technology. So what technology to choose for the service layer? I know PHP of old, but the dynamic, untyped feel of the language, just doesn’t feel right working side by side with flex.
Flex draws much of it’s inspiration from Java. And thinking in ActionScript and thinking in Java just feels right. (I’ve explored Scala but the tooling and best practices are not there yet for someone like me to adopt this great new language). I’ve chosen to learn java, hoping that it will make patterns and knowledge reusable between the server-side-programming and the client-side-programming.
The problem with java is it’s complexity and that it’s harder to deploy (for PHP you could easily deploy on a cheep webhotel). My idea is a test and I don’t want costs and servers (who does?). I want to focus on exploring my ideas. So I’m looking at Google App Engine who offers a free amount of Java quota for a startup web applications.
The problem with Google App engine is that it’s restrictive Sandbox model, and many frameworks doesn’t deploy as is.
I want a technology line that will work together with a minimum amount of hacking. And this is where I’m asking for your expertise, helping me choose the right frameworks for integrating FLEX with Java on the Google App engine.
I want to use strongly typed objects from server to client so I’m looking for an AMF solution. From what I can tell looking at forums BlazeDS needs hacking, Pimento/Cinnamon doesn’t work, Weborb or Adobe Livecykle aren’t free. GraniteDS however seams to be working on the Google app store without patching.
GraniteDS comes with a client framework called Tide that integrates with serverside technologies. But once again Google App Engine is a restrictive environment. Seam (which seams to integrate the best with Tide) seams to be a hack job on Google app engine. EJB3 or CDI is Java EE 6 technologies and not supported by Jetty (the servlet container powering Google App Engine). Spring seams like a viable candidate however.
The Google app engine dosen’t have a relational database, but has interfaced It’s new datastore behind the JPA interface that both Spring and Tide (GraniteDS) supports.
I’m not sure all this rambling makes any of us any the wiser.
What I’m asking is this: From FLEX to the Google App Store, what line of technologies gives me the least rope to hang myself with? Im suggesting Tide/GraniteDS/Java/Spring/JPA. But what do I know until I’ve tried it.
Given the vagueness of the question:
I'm using Flex/Cairgorme/Blazeds/JBossAS/Oracle Java EE together for a mission critical, high performance, scalable application. I would highly recommend this combo.
I am new to both JAVA and Google App Engine. My Interest in Java stems from its compiled nature, speed and widespread enterprise use, whereas my interest in app engine is mainly because of it's initial free nature along with scalalbility.
I have been through Google's Getting Started and FAQ, I have modified the guestbook app and generally played around with the datastore, creating a simple entry system for use at work, using database schemas similar to the guestbook app. I come from a hackish PHP background, and most of my app consists of JSP pages with HTML and scriptlets mixed, with classes for the datastore stuff.
I have read about JSP, JSTL & JSF(not much) and also the basics of appengine, it's limitations,strengths and quotas. I also understand that my current approach is flawed. I have searched for JAVA frameworks and found one too many. I have been through the Will it play in App Engine list, but I do no half of the stuff mentioned there. I understand that webapp(used in the overview) is a framework and so is GWT. I understand I have to learn core java first.
What framework should I begin with which is easy to use and also robust/secure enough to handle a financial app? The framework should also have value, if I were to host it in a pure J2EE environment independent of App Engine.
I would appreciate a word on study resources too. Currently I see this book on amazon as a resource but are there cheaper alternatives like a library with a monthly subscription from where I can peruse similar books.(and I know that Google is a real good resource.)
Are there any developers here who have apps hosted on appengine java and would like to share their personal experience of appengine java with a beginner?
I use Eclipse with the Google App Engine plugin to develop and upload my apps.
Regardless of what you want to do in Java you absolutely need to learn your way around the core language and the basic part of the runtime library.
The Java Tutorial covers this and is pretty straightforward.
Then you need to learn the Servlet API which underlies almost all Java-based web solutions today. Sun puts this in the full Java EE tutorial (which is a bit heavy) so have a look at this quick overview.
When you have gotten so far, you have a much better idea of what your basic toolbox is, and can give information allowing to give better advice on what technologies you should choose.
Sorry for the steep learning curve, but the view on top is fantastic.
If you aren't doing Java development currently, and/or haven't done much web development. I definitely wouldn't complicate things with adding frameworks.
What are you trying to accomplish that you need a framework for outside of the Google App Engine stack?
I've been developing with Java for years and only started using Spring with my Google App Engine app because I need a good security and authentication option. I wish I didn't have to use it since it's a rather steep learning curve.
You should be able to do most everything you need to for a simple app with JSP. If done correctly you can even do it in MVC if you wish.
On top of everything else people have recommended, I suggest you take a look at Objectify, a much simpler datastore API than the JDO/JPA ones included in the App Engine SDK.
This is, of course, after you've gotten familiar with the core of Java first.