Breezejs and java - java

I am new in breezejs and just have to know whether it supports Java Server like Tomcat or not..
I mean I saw 100's of examples using Breeze and Asp.net server but didn't saw any example using Java server, please shed some light on this;

well this was on the breeze FAQ
Based on your documentation, it looks like Breeze is hardwired for .NET. You're even using Visual Studio in your samples.
Yes, our initial launch shows Breeze using Visual Studio with a .NET Entity Framework back-end.
To be clear, Breeze does not require .NET, but this is currently how we have the data provider hooked up through WebAPI. We are planning to support other back-ends and front-ends, as well as show IDEs other than Visual Studio. Your feedback on UserVoice helps us prioritize these features.

Work is well underway on a Java backend for Breeze, using Hibernate and JAX-RS. Please check out breezejs-hibernate.
The NorthBreeze sample is a web application (WAR) that uses the breezejs-hibernate library. We build it with Maven and deploy it on Tomcat. It uses Angular for the UI bits. It's still pretty rough.

Ankur, please add this request to the breeze User Voice ( and vote for it). We take these suggestions seriously when determining what features/samples to work on next.

Related

Setting up MySQL and Apache for RESTful webservices

Can anybody point me in the right direction for instructions on setting up the following items on a Windows development PC?
Setup a MySQL database.
Setup an Apache webserver, a framework plus an IDE so that I can write RESTful APIs using Java and JSON.
I am using this to write a native Android and IOS mobile app that will store and retrieve data from the MySql database using the RESTful APIs on the Apache web server.
I have searched through several tech books, Google and Stack Overflow but cannot find anything that contains the above specific items. Within Stack Overflow, the following two links proved useful but do not give the specific items that I need. Android - Ruby on Rails - MySQL AND Best practice selecting database for mobile app
If you are planning to develop RESTful APIs using a Windows development PC, you could consider some of the available software bundles like XAMPP (https://www.apachefriends.org/index.html), which include an Apache distribution containing MariaDB (successor of MySQL, you can work with MariaDB as you would in MySQL), PHP (server-side language), and Perl (not neccesary) in a single Windows installer. Then, once you install it, you will have a complete web development environment up and running.
Then, considering that you develop your APIs using PHP as the server-side programming language (which I strongly recommend you as it is the most widely used language for this purpose), several additional decisions have to be taken, in terms of deciding about:
The IDE to develop in. When working with PHP, I recommend you PHPStorm IDE (https://www.jetbrains.com/phpstorm). The best in my humble opinion. However, quite complex and not very easy, but it completely worths learning.
The PHP framework. Unless you want to manually program your APIs (completely madness), you will have to use one of the many available PHP frameworks. In this case, I recommend you Laravel Framework (http://laravel.com). As far I have seen and worked, the best present and future option concerning PHP development. You could then install some RESTful API specific package in top of Laravel to speed up the development, like Dingo/API (https://github.com/dingo/api).
I insist this is just my recommendation, but you have to know that behind all that languages and frameworks there is a quite long and hard learning curve.
Good luck anyway!
1) To install MySQL on Windows refer to this official MySQL guide.
You will need to download and then extract the zip file (I would recommend the Community Edition). You will have all the details you need in the link above. Note that the .msi installer for Windows is no longer available for newer versions of MySQL.
2) Since you are going to use Java, you do not need the Apache web server (httpd) but you need Apache Tomcat as a servlet container (or other alternatives like Glassfish, JBoss as full Java EE application servers).
For building RESTful Web APIs in Java, Jersey is very good option (https://jersey.java.net).
Finally, as an IDE you can use anything, the most popular being Eclipse, NetBeans and IntelliJ IDEA.

existing app (java/eclipse/android) to other platform

I wrote an application for android (order information, order details, booking timestamps with webservice and webdav) on eclipse.
Is my code reusable for other platforms (e.g. ios, windows phone)?
Thank you for helping me.
michael
You native Android code is not re-usable. But, if you also wrote Webservices (As I understood), you can consume them from other platforms considering they are interoperable (SOAP, REST with JSON/XML, etc...)
To the best of my knowledge, nope not. If you had use cross platform tools like phone-gap etc, where you program in java script, then it becomes portable..
if you develop app with native SDK your code is not reusable on another platform but it will be helpful to you to get logic and all flow details from the existing code.
You have developed your application using java, the native code can't be used for other platforms such as iOS or windows as they have there own native languages which they use for development. You can use your web services code for all platforms if it's based on REST, JSON/XML.

How to create Web Services in Java (with Eclipse)

I am really really having hard time to create simple "Hello World" Web Service in Java. If you exclude several mobile Android mobile apps I have done, I am pretty new to Java environment.
First I tried Axis2 and that simply doesn't work out of the box. Fresh installation of Eclipse, Tomcat 6.0 and Axis2. Tried sample test app and it failed miserably. You can read about it here. My conclusion is that Axis2 simply doesn't work (maybe it used to work). I will try to go back to install older versions, maybe one will magically start working. I have to modify some old project at work that was using Axis2, so that's why I have to stick with it. I would hate to have to migrate to some other tool.
Then I ran on Oracle article Getting Started with JAX-RPC and I was thinking, cool, let's try that. Well, I just managed to get pissed off. After getting half way through the article and trying to write some simple test web service I realized that their code examples are poorly written. Missing brackets, wrong references, missing explanations, etc...
First of all, an interface should extend not implement. Am I right?
public interface SunRegPort implements java.rmi.Remote {
Also, this doesn't exist:
import java.xml.rpc.server.ServiceLifecycle;
But this does:
import javax.xml.rpc.server.ServiceLifecycle;
Well, I don't feel competent to criticize too much (cause of my level of knowledge about this subject of course), but after all I am suspicious that this article is complete JUNK and therefore I am not able to follow it.
Please somebody tell me that I am wrong and if anybody has some advice or link to some How-To page that talks about web services, I would appreciate.
Thanks.
The terminology Web Services is pretty vague. In Java, the modern and reasonably easy way to do this is by annotating classes.
I would recommend that first, you decide whether you want to implement:
SOAP Web Services -> look at JAX-WS
REST Web Services -> look at JAX-RS
Once you have chosen the "type" of Web Services, choose the library that implements the specification.
The Wikipedia entries list a few of these implementations. Apache CXF (complete but a beast), Jersey (popular) and Restlet are very common choices. I personally like the JBoss implementations as well for JAX-WS.
For JAX-WS with Apache CXF, here is a quick start tutorial that looks pretty good (untested)
For JAX-RS with Jersey, try this
Unless you have strong reasons to do otherwise (for instance you need to call an existing system), use REST which is simpler and leaner.
I would recommend you to check out the CXF project by apache. It's quite easy to use and should help you to set up a webservice.
There is a nice guide to Hello world set up.
http://cxf.apache.org/docs/a-simple-jax-ws-service.html
If you're still interested in giving Tomcat a shot, here is a tutorial on youtube of making a very basic "Hello world" example using Eclipse. It leaves a lot to learn; but it looks like it will at least get you started.
FYI, the version of Eclipse used is slightly outdated. So some of the menu options may not be exactly the same:
http://www.youtube.com/watch?v=EOkN5IPoJVs
Also, the meaning of "Web Service" can be subjective. So, to be specific; this just shows you how to get a basic HTTP endpoint started on your local machine.
If you are not tied to Eclipse, give NetBeans a shot. I think it's much better for Web Services in Java.
Web Services are most widely implemented examples of Service Oriented Architecture (SOA). A service contract is defined with the help of SOAP and Web Service Definition Language (WSDL) and that is published for other applications to use.
In this article we will see how we can create web service and web service client in java.
http://www.opencodez.com/java/how-to-build-and-deploy-web-service-and-client-in-java.htm

Java for intermediate .NET Developer

I am a .NET Developer with about 5 years of web development experience using Microsoft technologies starting with classic ASP to ASP .NET 3.5.
I do have a little background in Java as well and can write/understand Java code very easily. I am looking for resources (online, books) that are compatible with my .NET experience. I am only interested in web development in Java and want to start at intermediate level even if it may require me to look up some details.
What path or resources would you recommend for intermediate .NET web developers to gain equivalent proficiency in Java web development tools?
Get an IDE: IntelliJ (my preference), Eclipse, Netbeans;
Get an application server: Glassfish (my preference; either v2 or v3 Prelude), JBoss or, if you're feeling adventurous, SpringSource dm server;
Get a JDK eg 6u11;
Get a copy of Spring 2.5.6 (or 3.0M2 if you're feeling adventurous);
Get a copy of the Spring reference documentation;
Put the pieces together.
Get yourself a copy of eclipse, and just start reading other people's code, and reading some java docs. The Java website has all the docs online, and they're one of the best language specs I've seen.
Really, if you know C# pretty well, Java should be a cake walk. The languages are pretty similar, so you just need to get to know the different frameworks.
Probably the most helpful book in regards to learning Java's web development framework, Java Server Faces:
Core JSF
- Great examples and explainations throughout on the whole process of using the JSF Framework.
And of course for anyone new to Java I would recommend:
Effective Java
- Covers various design patterns and practices.
In my experience that official Java exams are better than the .Net equivalents, so it may be worth starting there?
Search for a servlet/JSP tutorial (Good, albeit a little old, example here).
You'll get basic knowledge of Java web application development.
Whatever your level is, JSF for Nonbelievers is the best introduction to JSP/JSF.
I'd check out Bitter Java.
It's a book that shows you the wrong way to do things, why it's wrong, and then it shows you the right way.
It pretty much falls in line with the evolution of the j2ee framework. Started with servlets, then moved into jsps, then command pattern, etc.

Porting from PHP to Java - framework recommendations?

Im porting a project from php to java. The project is a web-app based on php and ajax techniques with a javascript front-end. What java-frameworks would you use for something like this?
Does the result have to be written in Java, or does it just have to run on the JVM? In the latter case, you might want to consider Grails, which uses Groovy, a Java-based dynamic language that compiles to Java byte code and has full access to the Java standard API.
How well do you know Java?
Why are you porting it?
I can't really tell based on your description, but there are lots of Java web frameworks out there. Pick one. I prefer Spring.
I fear that you're about to be very disappointed. I anticipate a lot of questions like "Why can't I do X in Java? It's easy in PHP!"
Apache Wicket is a possible java based web framework you might consider. The default would be the java servlet and jsp frameworks.
without seeing the source code - you will need a complete rewrite. just "porting" will probably not work.
out of all available frameworks i'd recommend two: wicket if you want clean lightweight technology. with ajax. jsf/seam if you are in a corporate environment where it it easy to get tons of experienced developers.
I really like Stripes.
There's a really good book out on it too. Stripes ... and Java Web Development is Fun Again.
This question seems to come up alot. Related:
What Web Application Framework for Java is Recommended?
Best java mvc framework implementation for web apps
Does it make sense to use a framework for a simple java web app?
What language/platform to choose for a new web application?
In my opinion you would still do the same but generate the html with JSP and javabeans instead of php. javascripts and ajax will still work without a problem if the outputed html is the same.
It depends by the size of your project, the features and your resources.
If the project have'nt a lot of particular needs you can use Struts. Thsi is a stable framework, not really advanced but simple and powerfull for the development.
Another frameworks more recent and advanced are Spring and Wicket.
Before you start, I recommend you to do a check-list of your need:
Do you must porting a O/R mapping too?
Have you a stable developer knowing Java/J2EE?
Do you think to add some feature during the porting or in short-run?
etc etc
good luck! :)
I would port it to GWT
Google Web Toolkit (GWT) is a development toolkit for building and optimizing complex browser-based applications. Its goal is to enable productive development of high-performance web applications without the developer having to be an expert in browser quirks, XMLHttpRequest, and JavaScript. GWT is used by many products at Google, including Google Wave and the new version of AdWords. It's open source, completely free, and used by thousands of developers around the world.

Categories