Simplest way to make java crud app [closed] - java

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 9 years ago.
Improve this question
I am trying study web development using Java but its seems very intimidating. all the tutorials are showing very complex methods, even the sample applications that came with NetBeans. I have some experience working with PHP but none with java.
Is there any simple way to use java on the server to just accept post requests and save to database and then display data from database without using things like javaServer faces?
Is it necessary to use frameworks like spring?
Pls forgive if i am asking stupid questions. i cant seem to find where to start learning from and tutorials seem too confusing.
Links to any good article will be very helpful
Thanks

For this purpose you should be familiar with the Servlet API, and preferably also with MVC frameworks and so on.
For the whole world to be a bit more straightforward for you and to steer away from the average-PHP-community-drawbacks (e.g. nobody tells you how to code well), I'd recommend to read THIS book.
But first of all, start HERE and then move on to THIS SITE.
The other way around (talking about DB access, not the web service here) is using raw SQL via JDBC which I won't recommend unless you have a good reason for it and you're already familiar with using a DB the right way (mysql and mysqli libs of PHP won't necessarily drive you the right path; PDO most probably will however).
Of course you don't necessarily need to use frameworks, but you're (actually in any language) way better off using them. Yes, probably the closest thing to the "nobrainers-php-methodology" (mindless coding; wiring UI, DB access and business logic together in a single file; etc.) is using the Servlet API, and then through a java.sql.Connection send your GET/POST data directly to the DB via JDBC. But doing so is slightly worse than cruelly murdering cute little squirrels/bunnies/kitties/insert_your_favourite_cute_creature_here
You'll also need a servlet container, most common of which is Apache Tomcat.

To learn Web Developing with Java Play Framework 1 is very nice:
Step by Step guide for a cool blog: http://www.playframework.com/documentation/1.2.7/guide1
Documentation: http://www.playframework.com/documentation/1.2.7/home
CRUD module documentation: http://www.playframework.com/documentation/1.2.7/crud
You get compile feedback directly in the browser.
Run your tests in the browser.
No redeployment to containers necessary/hot deployment.
No servlets.
Play 2 is already around, but going through Play 1 is much simpler if you are new a the Java world.

Related

Best practices when learning a new API [closed]

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 2 years ago.
Improve this question
When learning/working with a new API, does anyone have any tips for effectively learning it?
I currently make a bunch of get requests to understand what I can and cannot retrieve based on the API's responses. From that point I try to map out what is within the API and see what I can build out.
If you guys could share anything what you do that would be great.
The first thing i do is to read API documentation and search for examples in it. As you get used to read this kind of docs you'll find easier to find exactly what parts of the functionality you need to learn first.
I also use search engines to look for more working examples, and after that I work on creating a minimal use case of the API (for example write a file with commons-io api of apache). For this is a good idea to create a project with multiple JUnit tests with minimal use cases of an API (in the example of commons-io create a file, delete a file, move a file, copy a file, ...).
I must say this is not a science and each API is a new world and may require a slightly differnt approach (As with rest apis you'll need to use some tool like curl or postman to understand how to communicate with them, others will have pre-requirements like have a working installation of a system, and so on).
As everything in coding you'll need to do it by yourself and struggle to solve issues you'll find by yourself (what can take several hours of your free time).
There is no "magic" behind learning something, and coding is in some way like playing a musical instrument, it requires practice.
I dont know whether you are a beginner or you have developed already but will start from scratch..!!
Apis are the code which will allow you to play with the content having certain formats...!!
There are apis based on what operations you want to do are.
Get=> In order to fetch something.
Post=> In order to save something.
Put => to update something.
Delete => to delete something.
People also use patch similar to update...!!
You can play around all these by constructing objects and databases...!!
You will require rest services spring restful web service is the ultimate good options..!!
Diving deeper you need to be careful assigning the names you give I mean the meaningful names as you dont know if tomorrow you become famous and need to make your apis sharable ;)
Now some common concerns are like
Meaningful Name.
Versioning is required like what the old apis are working and now what data your apis give.
Can implement swagger its a tool which will allow you to describe the apis like you can write what this api does what type of data it brings etc etc..!!
Apis are more or less called an end points means you have that link as a connection between front end and backend So need to keep it secure..!! By authentication.
Above four points are considered to be good practises for writing apis ;)

UI recommendation in Netbeans for a Maven web application [closed]

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.

Quick to develop web app in Java [closed]

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 7 years ago.
Improve this question
I need to develop a basic web app very quickly (1 week) for a demo.
My requirements are
Java (I need to make use of existing Java libraries to access the relevant data)
2 screens
One for static data view, maybe some search parameters
Other for basic form entry
No fancy AJAX required
Ideally easy for a web designer to come in and tart it up as necessary, without having to rewrite everything
My first stop was going to be to checkout Wicket as I've heard good things about it. I don't have the time right now to dive into anything heavy, which probably writes off JSF in my mind (I played with JSF1, steep learning curve which I've now slid back down).
I'm happy to treat the result as throwaway so if there's a framework which starts of well but then doesn't scale up to bigger projects, that would be ok.
Any suggestions appreciated on frameworks/approach.
Spring roo can very quickly create web applications using GWT for CRUD, and tarting it up later. Check out the Keynote from Google I/O 2010 (Especially Day 1, Part 9) where the skeleton of a basic expense tracking application is developed from scratch in about 2 minutes.
GWT support is in Roo 1.1.0.M1
As a milestone release, Roo 1.1.0.M1 isn't intended for mission-critical use.
It is probably easiest to get in the form already integrated with the eclipse based SpringSource Tool Suite
I suggest the Play framework which has the huge advantage to be full Java (so less learning curve if you don't know Groovy). Check out the demo!
Use Groovy/Grails. Full access to all Java libraries and you will be done so much faster it will make your head spin.
This is from a hardcore java user, by the way. It's just not the appropriate language for most web apps.
Oh, you could probably also use JRuby on rails.
Google App Engine. There are some good video tutorials from Google that get you up and running in no-time.
http://code.google.com/appengine/
Intro (< 10 min): http://www.youtube.com/watch?v=bfgO-LXGpTM
Check out CUBA platfrom, it matches your requitements.
I can suggest GWT. It works on Google App Engine too if this is an internet app.

How do I get started building web apps with Java? [closed]

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 8 years ago.
Improve this question
I want to start web developing with java. I don't know how to start, what to learn,
or what is the best web framework to learn and use. Help me out?
I assume, that you're only new to web apps and not to Java itself.
For a starter, I can recommend the Apache Wicket framework for the front end. Their web site is full of examples, the mailing lists are a great place to get started, and Wicket in Action was an enjoyable read.
If you want to work with Java Server Pages (JSP), then you should definitely also include Java Server Faces (JSF) which make working with JSPs a lot easier. I can't advocate any good books to you as I went for web tutorials mainly. You might want to have a look at Apache MyFaces.
For the business logik, I guess the standard is Enterprise JavaBeans (EJB). I liked Mastering Enterprise JavaBeans 3.0. An older version of the book is available for free at TheServerSide.com. You should avoid EJB versions older than 3.0, because they are a PITA!
A separate part of the EJB 3.0 specification is the Java Persistence API 1.0 (see, e.g., Apache OpenJPA though the documentation is patchy). Other frameworks that support JPA are, e.g., Spring or JPOX (now being called DataNucleus).
Finally, if you want an application server for testing, there are JBoss by RedHat, SUN's Glassfish and Apache Geronimo (I preferred the last one, but you may have noticed my preference for Apache projects already ;-))
Good luck!
Well if you do not know much about Java, then first I suggest going back and getting your foundation in Java strong first (cause after all JSPs are java code embedded inside HTML), then proceed to learning about servlets and then move on to JSPs.
As far as learning JSPs is concerned, I would suggest buy a book, Head First Servlets and JSP is pretty good book.
Head First Servlets and JSP
JSP Tutorial
Getting Started with Web application - JSP/Servlet
I think Grails is a great way to get started. You can use the scaffolding to get started quickly, which allows you to dip down into the more complex aspects of Java web development at your own pace. I recommend you watch this screencast to see what you think.
This is a big subject and you will need to learn a lot.
I can recommend first learning Java very well.
Head First Java - http://books.google.dk/books?id=5VTBuvfZDyoC
The Java Tutorial - http://java.sun.com/docs/books/tutorial/
You will need to be very proficient in Java, as most framework documentation expect this of you.
When you have those under your belt, you are much better equipped to determine which framework is best for you, as that very much depends on which facilities you actually need, and which you do not have any use for.
The WEB4J tool is likely worth a look.
It has a much smaller number of classes in comparison with other tools. It is "full stack", so it helps you build all parts of your web app. Thus, you don't have to learn several different tools - just one.
A college instructor related to me that he felt it was "almost perfect" for his students, since it was at just the right level, and didn't hide things behind complicated abstractions - it was plain to see how all the parts worked together.
If you know java you can always start reading this book, https://secure.manning.com/books/deshmukh It will give you the basic foundation for java web development.

What would you use to build a web app? [closed]

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 5 years ago.
Improve this question
At my current job I've been working on making web apps with Java, Tapestry, Hibernate, MSSQL, and Tomcat.
I've got an idea for a little web game I'd like to write. I'd like to know what the SO community would use for something like this.
Should I stick to what I know? I was thinking it would be very beneficial for me to learn different languages and frameworks. Any suggestions?
If its a personal project then take this as an opportunity to learn something new.
Spring Framework using Spring MVC 3.0
I recommend learning something new because even if your idea is a failure, at least you learned some new technology out of it.
I can suggest Grails as it is a modern and easy to use RAD Web-Framework, has a small learning curve and is proven to be scaleable.
It builds upon Spring MVC, Hibernate and other sophisticated frameworks and merges them with the dynamic nature of Groovy (dynamic language for the JVM) into a full-stack webframework. It follows modern principles like CoC (Convention over Configuration) and DRY (Don't repeat yourself). You can deploy the applications straightforward as .war file in tomcat or any other servlet container or applications server.
My recommendation would be to see what you could do with a combination of Google App Engine, Django, and JavaFX.
In doing so, you'd learn some new technologies (App Engine) and languages (Python for Django, JavaFX) while taking advantage of what you already know about web apps and Java.
I'd pick Haxe.
Haxe (pronounced as hex) is an open source programming language
While most other languages are bound to their own platform (Java to the JVM, C# to .Net, ActionScript to the Flash Player), Haxe is a multiplatform language.
It means that you can use Haxe to target the following platforms : Javascript, Flash, NekoVM, PHP, C++, C# and Java
If your thinking about an online game like a RPG or card game I might be selfish and suggest you have a look at Project Darkstar and let us know how you got on. I've been trying to get started with it and cannot get it up running in my environment.
PHP and MySQL is an easy place to start for web apps. Your ISP will support it and there are tons of tutorials on the web.
Once you have got the hang of it, take a look at MVC architecture. It's a way of structuring web apps.
Personally I'd then recommend looking at CodeIgniter.
However a game is a different matter, maybe try Flash?
If you want to improve your skills push what you already know. If you want to learn new languages and ways of doing things, then look at alternative technologies and stacks.
It all depends on what your goals are...

Categories

Resources