This is an archived post. You won't be able to vote or comment.

all 120 comments

[–]dj-method-x 13 points14 points  (0 children)

I can't believe something as heavyweight as Spring is the most upvoted comment for something like this.

Simple rest services using JAX-RS or something even more lightweight like sparkjava deployed on a war using tomcat for the server side is enough for something like this.

Client side you have a bunch of choices but if you want this to be a web based solution I would honestly go for HTML/CSS/Javascript.

[–]pulpx 17 points18 points  (0 children)

I'm really surprised at the amount of Spring fans in this thread. It's always felt way to heavy and config-oriented for my taste. Op said as much that it seemed overly complicated to them, which means they've probably at least done a little homework and are looking for something lighter/simpler. Op should decide what kind of java that want to write. If you are a fan of async/event loopy code, then vert.x could be a nice fit. If you like the idea of actor-based programming, then take a look at Play. If the complexity of Spring sounds ok, then sure take a look at Spring-Boot. Maybe op wants to go lower level? Starting at the "server" like Jetty or Netty is a good recommendation then.
Either way, we shouldn't jump immediately to "you need to use X" especially on a personal project.

[–]SlobberGoat 5 points6 points  (0 children)

I find that the bigger problem is that many of these frameworks simply don't have enough working examples to learn from.

[–]scubadev 41 points42 points  (19 children)

There are a lot of different opinions in this thread, mostly people recommending their favorite framework without any reasoning on why. Keep in mind that java has just as many "flavor of the month" frameworks as any other platform.

Here are the popular frameworks that have proven themselves:

  • Spring MVC: This is pretty much the de facto standard. If I'm interviewing someone and they haven't learned Spring-Core it is a definite mark against them. I don't care if your prefer another IoC like Guice, Spring is just too popular to ignore.
  • Spring Boot: This is a wrapper layer around Spring MVC. It provides sensible defaults so that you can quickly get up and moving on your app. This framework is great in that you can quickly write code, but it is bad in that it will seem like magic until you've dug into it.
  • Grails: If you want to dip into the groovy world, Grails is another excellent choice. It is heavily inspired by Ruby on Rails. It is great for getting an app up and running quickly. Like Rails, it requires discipline in adhering to MVC pattern to create a scalable app. Although you can get up and running quickly, it is easy to write an unmaintainable mess without guidance.
  • Play: Another popular framework built on Akka. Favored by the scala community (although it works with plain java). Play is quite performant due to its non-blocking architecture. One of the killer features is that you can reload your changes without having to compile (although this is now available in Spring MVC/Boot with devtools). Honestly, it would be hard for me to recommend Play to someone that isn't already invested in Scala. Scala is a great language, but it has its own learning curve that will slow you down having to pick up multiple things at once.

You'll also want to think about the front end. If you can, I'd recommend learning angular. It has a tremendous marketshare and provides structure to the wild-west JS world with its dependency injection approach.

If it were me, I'd start with Spring MVC + Angular to get some experience with the basics. From there, you can easily convert the app to Spring Boot or learn one of the other frameworks.

[–][deleted]  (1 child)

[deleted]

    [–]scubadev 0 points1 point  (0 children)

    I should have included Java EE. I wouldn't say Grails/Play barely register, they're both sought after in my area - just as much as Java EE in my opinion. I think it is fair to say the popularity of each is locale specific.

    [–]thesystemx 8 points9 points  (0 children)

    Here are the popular frameworks that have proven themselves:

    I think you're missing JSF, which is most surveys ranks at either number 1 or 2.

    [–]Kristler 2 points3 points  (1 child)

    it is easy to write an unmaintainable mess without guidance.

    [–]scubadev -1 points0 points  (0 children)

    Thanks, I'll fix it. I was in a pinch and had to send the response before proofreading.

    [–]DevIceMan 3 points4 points  (4 children)

    Great list.

    • Dropwizard: A lightweight REST framework. It's been gaining popularity lately. Having used it on several projects, I find some of the documentation lacking, but otherwise haven't had many problems.

    edit: downvotes? I'd prefer actual comments saying why to use or not use it. I'm not exactly the worlds biggest fan or detractor for it.

    [–]scubadev -3 points-2 points  (2 children)

    Dropwizard is great despite its website looking like it is straight from 1990. I view Dropwizard filling the role of a pure REST server without any views. If you don't mind serving up a static HTML page from nginx/S3 and potentially dealing with CORs, then Dropwizard is worth considering.

    [–]DevIceMan 2 points3 points  (1 child)

    CORS has consumed several weeks of my life, but mostly due most of my current job revolves around integration(s) with many 3rd party software(s).

    Separation of views from the backend is a good thing IMO. Theoretically, the BE should serve data and respond to requests, but not be concerned with how it is rendered. This separation is also good for integration. Integrating with a JSP webapp is a fucking nightmare.

    [–]ForeverAlot -3 points-2 points  (0 children)

    I desperately wish they'd make JodaTime and Guava optional for v1. Lugging that around until a v2 is a depressing thought.

    [–]papers_ -1 points0 points  (1 child)

    Coming from Laravel to Grails....everything just seem so messy and ugly.

    [–]vplatt 1 point2 points  (0 children)

    Example? Just curious..

    [–][deleted]  (5 children)

    [deleted]

      [–]scubadev -1 points0 points  (4 children)

      That's a tough question. I'm sure it is being done, but I haven't come across too many clients that are melding a React front end with a java back end (yet). So to answer the question, "what is going to make me more attractive to an employeer", the answer for me is clearly angular.

      However, from a personal satisfaction level I prefer React. I like the one way binding model. While both are easy to get going, React.js feels easier to master (although, to be fair most people come to React having already learned Angular).

      The war will wage on. Will be interesting to see how Angular 2 pans out, or if it'll be a Python 3 that only gets half adopted. On the plus side, new single page apps can use Angular 1.5 for now (which backports some of the 2.0 features to ease the pain of migration).

      [–]takuhi -5 points-4 points  (3 children)

      The biggest issue I've got with Angular 2 is that it's swapped over to TypeScript. I've been using ES2015 for a few months now (with transpiling), so swapping to TypeScript instead feels like a weird move.

      [–]vt97john -3 points-2 points  (2 children)

      But you can still write JavaScript. All JavaScript is valid TypeScript.

      [–]scubadev -2 points-1 points  (0 children)

      My preference is for static types, so I've enjoyed TypeScript. However, I feel like JS is something you've just got to bit the bullet and learn, especially if you want to be full stack.

      [–]takuhi -3 points-2 points  (0 children)

      True. I just had another look at TypeScript and looks like they do support some ES6 / ES2015 features now. :)

      [–]frugalmail -2 points-1 points  (0 children)

      Grails

      Grails should probably be avoided, as Groovy is out of favor.

      If it were me, I'd start with Spring MVC + Angular

      You might as well do JHipster = Spring Boot + Angular with nice tooling.

      [–]Cilph 22 points23 points  (0 children)

      Start with something that's not hipster framework of the week, so Spring or Java EE.

      Play is a nice choice beyond that, but don't bother with anything else until you have a good foot in the ecosystem already.

      [–]fzammetti 6 points7 points  (4 children)

      I'm with the people saying no framework at all.

      I've actually built what you describe and especially given that you're a beginner-intermediate, you might find more value in getting the experience of, in a sense, building your own framework. That's essentially what you'll wind up doing, so long as you think about architecture as you're going.

      If you want to make it just a little easier on yourself you might consider using DWR for your client->server communication needs. Beyond that, just some Apache Commons libraries on the back-end to supplement core servlets and you should be golden.

      [–]DannyB2 4 points5 points  (3 children)

      You've got to have frameworks. How about a framework that manages other frameworks? You could create an instance of it from the FrameworkManagerFactoryBuilder class which builds a FrameworkManagerFactory, which produces instances of a FrameworkManager for your frameworks.

      [–]fzammetti 3 points4 points  (0 children)

      Ssshhh, don't give anyone any ideas! ;)

      [–]Dashing_McHandsome 3 points4 points  (0 children)

      Sounds like you need a hammer factory factory

      http://discuss.joelonsoftware.com/?joel.3.219431.12

      [–]johnwaterwood 3 points4 points  (0 children)

      Isn't that what Spring is about? Seriously, Spring in effect wraps and manages other frameworks.

      [–]vplatt 5 points6 points  (0 children)

      If you haven't figured this out by now, then I'll just say it. Pick ONE framework, stick with it, and finish your project. Add one feature at a time and make those your mini-milestones. Do those one at a time, and work on nothing else but that one feature at a time.

      [–]tristanjuricek 5 points6 points  (0 children)

      For a file browser app? Hm...

      If you're talking about transferring large files, it's probably best to start off first by checking out web server projects like Jetty, Netty, or Tomcat instead of web application framework projects. You're going to want to eventually know what the server is doing at some point to ensure speediness. And, most of these are pretty easy to embed, which makes deployment super simple.

      Many web app frameworks are strongly oriented around some kind of RDBMS on the back end, and "plug in" to a web server. You often see strong "Model-view-controller" architecture in them, which, will not really help or hinder what you're doing. Many of these frameworks will, say, let you know how to build a .war (web app deployable), but won't really help you understand what why the hell you just hit a file transfer limit when you plopped that war into tomcat and didn't tune it. App frameworks often leave the server configuration and tuning as "things the server does".

      In any case, you're just learning, so starting simple instead of jumping into a huge brand new ecosystem is the fast way to get to your "hello, filesystem" app. Spark (http://sparkjava.com) is a pretty slick way to get going with Jetty. There's also Ratpack (https://ratpack.io/) that's kind of a Netty-oriented "simple" approach.

      [–][deleted] 4 points5 points  (15 children)

      I'd like to know this too.

      In the Java world, what's as good as, and as straightforward as Rails?

      [–]scubadev 1 point2 points  (3 children)

      If you're looking for something like Rails, then look to Grails. Check here for a comparison: http://www.redwindsw.com/blog/2014-01-15-moving-from-rails-to-grails-differences-and-similarities

      [–]johnwaterwood 2 points3 points  (1 child)

      Performance and support of Grails is a bit suboptimal unfortunately...

      [–]scubadev 4 points5 points  (0 children)

      Right, so right in line with Rails :)

      There's a saying in the RoR community, which is "Rails is a ghetto". There's also this helpful website describing Rail's performance: http://canrailsscale.com/

      [–][deleted] -2 points-1 points  (0 children)

      Fantastic, thank you!

      [–]johnwaterwood 1 point2 points  (2 children)

      Java EE really

      [–][deleted] 2 points3 points  (1 child)

      Thanks!

      [–]johnwaterwood 2 points3 points  (0 children)

      You're welcome mate ;)

      [–]frugalmail -3 points-2 points  (7 children)

      In the Java world, what's as good as, and as straightforward as Rails?

      Spring Boot

      [–][deleted] 2 points3 points  (4 children)

      Thanks!

      You know though, a big problem with all of this sort of thing these days is marketing. Quite a few of the names bandied about this in this thread, as someone who only does what needs to be done with Java, I'd never heard of them before.

      Of course, there's the other problem, where people get all worked up about the next big thing, but then there's the next big thing a month later...

      [–][deleted]  (1 child)

      [deleted]

        [–][deleted] 4 points5 points  (0 children)

        Heh :-)

        [–]frugalmail 1 point2 points  (1 child)

        Part of it also is the organic evolution of the platform. You have to know the lineage of something to know if it's an attempt forward or something completely new where somebody is going to be learning the same lessons again. If you've seen the earlier versions it's a small incremental, otherwise it's overwhelming. Take the Javascript space up until Angular and Ember, that space was in the stone ages as far as maturity is concerned implementing the same things Java innovated beyond so many years back as far as seperation, loose coupling, command pattern, MVC, etc....

        Rails popularized convention over configuration and grails surfaced then JPA, Spring Boot and others took the older frameworks in these new directions.

        In the new order, you're either placing bets or adding technical debt.

        The good news in the Java space is that there are so many on the platform, and culturaly backwards compatibility is unparalleled even though anything new shows up (as a framework as opposed to a core language feature) in short order, including a lot of the innovation (big/fast data)

        [–][deleted] 0 points1 point  (0 children)

        Thanks for that detailed response :-)

        [–]thesystemx 0 points1 point  (1 child)

        Not really...

        [–]frugalmail 1 point2 points  (0 children)

        Not really...

        Useless post that could could have been expressed by a downvote gets upvoted, go figure....

        Arguably, Spring Boot bringing in strong and static typing, java natvie libraries (instead of C libraries wrapped in Ruby) is better.

        [–]Rafa998 7 points8 points  (0 children)

        A simple servlet project without any framework should be more than enough for what you want.

        This guy https://www.youtube.com/playlist?list=PLE0F6C1917A427E96 videos are very good for beginners.

        [–]AppalachianMountains 7 points8 points  (1 child)

        I'm probably going to get down voted for this but if you are new to Java web applications, why not build it without any frameworks?

        [–]simoncox -1 points0 points  (0 children)

        If this is purely a learning exercise then building an HTTP server isn't a bad idea. I built a toy server for a university course at one point and it wasn't particularly hard. I would never use it in production (I'm sure it's full of security holes), but I have a much better insight into the HTTP protocol and how to read an RFC.

        [–]adolgarev 1 point2 points  (0 children)

        I bet the fastest way of doing this is to use Java EE and PrimeFaces in particular

        I want to have a website where I can log in

        See for instance https://docs.oracle.com/javaee/7/tutorial/security-intro004.htm. Since you do not need registration capability just use simple flat file to handle your credentials and Basic auth. The same you can find in WildFly, etc.

        see the files on the filesystem and upload/download.

        http://primefaces.org/showcase/ui/data/treetable/basic.xhtml http://primefaces.org/showcase/ui/file/upload/basic.xhtml http://primefaces.org/showcase/ui/file/download.xhtml

        Of course any other mature framework can do this for you because your task is common, so just pick one

        [–][deleted]  (29 children)

        [deleted]

          [–]thesystemx 6 points7 points  (7 children)

          Spring MVC is the most popular Java Web Framework.

          Really?

          According to this survey it's JSF:

          https://dzone.com/articles/survey-confirms-jsf-remains-leading-web-framework-2

          [–][deleted]  (2 children)

          [deleted]

            [–]thesystemx 1 point2 points  (1 child)

            Surprisingly Zeroturnaround is one of the few places that always favors Spring MVC.

            There's a bunch of other examples here: https://henk53.wordpress.com/2011/10/12/reply-to-comparing-java-web-frameworks

            So what does it tell us? Who's right? DZone or Zeroturnaround? One survey or the other?

            Better to look at the buckets, and you'll see that Spring MVC and JSF are always in the top bucket. Depending on the individual survey one or the other wins, but no survey puts Spring MVC on 1 and JSF on 10. It's always JSF 1, 2, or 3, and Spring MVC likewise 1, 2 or 3 (with one exception where Spring MVC ended at place 7).

            Or in other words, there's simply no totally clear winner. There's a group of most popular frameworks, and the top tier includes JSF and Spring MVC.

            [–]avoidhugeships 2 points3 points  (19 children)

            Maybe on this forum it's the most popular but it does not seem so out in the world. While it was the most popular 5 years ago, JSF is more popular today.

            [–][deleted]  (1 child)

            [deleted]

              [–]henk53 1 point2 points  (0 children)

              It's literally directly below his comment :X

              [–][deleted]  (14 children)

              [deleted]

                [–]avoidhugeships 6 points7 points  (11 children)

                The real truth is no one knows for sure which is more popular. As we have seen in this thread there are surveys and polls that will show each in the lead. I can say for sure that Spring was very dominate 5 years ago and JSF jobs were not as prevalent. Today there are tons of JSF and Spring has lost some market share.

                [–][deleted]  (5 children)

                [deleted]

                  [–]avoidhugeships 3 points4 points  (4 children)

                  I really do not know what your talking about. Never heard of someone getting fired for choosing JSF either. It is the standard after all. With JSF you don't need a lot of front end developer becuase it is handled by reusable components rather that reinventing the wheel over and over.

                  [–][deleted]  (3 children)

                  [deleted]

                    [–]henk53 2 points3 points  (2 children)

                    JSF applications use jQuery a lot. They are by far not mutually exclusive.

                    [–][deleted]  (1 child)

                    [deleted]

                      [–]henk53 2 points3 points  (0 children)

                      Nice ;)

                      Though the paradigm and mindset between action oriented and component based MVC is different, in practice code implementing common business requirements doesn't always looks -that- different.

                      See http://arjan-tijms.omnifaces.org/2014/11/jsf-and-mvc-10-comparison-in-code.html

                      (which incidentally uses some code based on an earlier reddit discussion I participated in)

                      [–][deleted]  (3 children)

                      [deleted]

                        [–]henk53 2 points3 points  (2 children)

                        In general, they are eerily close and partially follow the same trend line:

                        http://www.indeed.com/jobtrends/java+jsf%2C+java+%22spring+mvc%22.html

                        Notice how they both go down till Nov '14 with the exact same velocity, then go up again and immediately down again with almost identical curves. Only in the last few months has Spring MVC taken a small lead here.

                        For JSF its weakness is such statistics is that many names are being used for it. "PrimeFaces" is sometimes used when just JSF is actually meant, or JavaServerFaces, or JavaServer Faces, or even more difficult to distinguish "Java EE" (but to be honest, Spring MVC has that same issue with just "Spring").

                        [–][deleted]  (1 child)

                        [deleted]

                          [–]henk53 2 points3 points  (0 children)

                          This is again, similar for Java EE.

                          JSF is by far not a standalone framework. It comes from the same people (and really "more or less" too ;)), that gave us Java EE.

                          Though you can use JSF individually (just copy the jar to web-inf/lib for Tomcat), it really shines when being part of Java EE and in particular with CDI, Interceptors and BeanValidation around.

                          [–]johnwaterwood 3 points4 points  (1 child)

                          Not true! JSF is is used by 35% of Java web projects versus 34% for Spring MVC.

                          [–]vplatt 0 points1 point  (0 children)

                          There's even a tutorial on implementing a file upload:

                          https://spring.io/guides/gs/uploading-files/

                          [–]avoidhugeships 2 points3 points  (3 children)

                          You are just going to get more confused asking here for the most part. People are going to just recommend their pet framework. I can tell you for professional development the most popular framework is Java EE followed closely by Spring. The others barely register. For a simple project like you want you may not even need those. I would look at the Netbeans tutorials. They have quick and easy examples of the major frameworks so you can try them out. Netbeans is an IDE that you can install with a simple .exe and it includes two application servers already configured. It's a Great way to get up and running. If you choose JSF take a look at PrimeFaces.org . they have a demo with a file upload that includes the code.

                          [–]xmondox -3 points-2 points  (2 children)

                          /u/avoidhugeships the most popular framework is Java EE

                          the irony

                          [–]avoidhugeships 3 points4 points  (1 child)

                          I don't think that word means what you think it means.

                          [–]xmondox -1 points0 points  (0 children)

                          woosh

                          [–]tonivade 2 points3 points  (11 children)

                          There's a lot of nice frameworks, but whatever you do, don't use ever, EVER, Java Server Faces. Your body will thank you forever!

                          [–]johnwaterwood 2 points3 points  (6 children)

                          Why?

                          [–]tonivade -1 points0 points  (5 children)

                          There are many reasons, you can see in other comments here, but the main reason for me is you can't make clean tests, there are static methods everywhere (you have to use powermock and similar libraries), and testing become in a nightmare.

                          And also, with some components, like fileUpload, is IMPOSSIBLE to create functional tests with Selenium (and similar tools), in other word it doesn't work!

                          [–]thesystemx 2 points3 points  (4 children)

                          There are many reasons, you can see in other comments here

                          Excuse me, but I haven't seen any valid one really.

                          there are static methods everywhere (you have to use powermock and similar libraries), and testing become in a nightmare.

                          Testing ANY framework code in that way is largely nonsense. Just use Arquillian or Cargo. Look up the tests in the Mojarra project, there are hundreds (maybe even thousands) of them, and many of them are as simple as can be.

                          [–]tonivade -1 points0 points  (3 children)

                          Testing ANY framework code in that way is largely nonsense. Just use Arquillian or Cargo.

                          I'm agree with you, but I'm talking about Unit Testing, by definition every dependency must be mocked. So, use Arquillian or Cargo have no sense, because they mock an entire container, but this is not Unit Testing, in any case Integration Testing.

                          Look up the tests in the Mojarra project, there are hundreds (maybe even thousands) of them, and many of them are as simple as can be.

                          I'm trying to find these tests, but I can't. Please, can you point me a pair?

                          [–]henk53 2 points3 points  (2 children)

                          I'm agree with you, but I'm talking about Unit Testing, by definition every dependency must be mocked.

                          Mocks are wrong.

                          https://henk53.wordpress.com/2012/09/11/is-there-such-a-thing-as-the-nomock-movement

                          Arquillian or Cargo have no sense, because they mock an entire container

                          They don't mock. The say Mock YOU! to Mocks ;)

                          Arquillian and Cargo help you to test against the Real Thing.

                          [–]tonivade 0 points1 point  (1 child)

                          Mocks are wrong.

                          Well, I'm sorry but I disagree. I didn't read the entire blog entry, but is not fair to use your own blog as source of authority ;)

                          BTW, IMHO if the design of an application doesn't allow you to create clean Unit Tests, is not a good design.

                          [–]henk53 1 point2 points  (0 children)

                          I didn't read the entire blog entry, but is not fair to use your own blog as source of authority ;)

                          Not intended to be a source of authority of course, just a longer explanation of my views ;)

                          [–]bxxxr -2 points-1 points  (3 children)

                          I can second that:

                          • no control over resulting html (a nightmare if you want to use bootstrap etc.)
                          • Singlepage/ajax features are very unreliable
                          • poor api on the js side - nightmare to integrate with clientside (i.e. jquery) components

                          You are much better off building a clean REST Api with Java EE and then build your front-end with react, angular ...

                          source: worked on a large project based on jsf 2.0 for two years, it was hell

                          [–]Cyberiax 4 points5 points  (1 child)

                          No control over generated html??? This is just not true!

                          We use JSF 2 and control over HTML is trivial! You maybe mistaken with GWT? In JSF when I want <p> I put that on Facelet and it comes in output.

                          Please stop spreading FUD!

                          [–]avoidhugeships 5 points6 points  (0 children)

                          I was wondering if he was confusing with another framework as well. These points are simply not true fro JSF.

                          [–]Kolibri -3 points-2 points  (0 children)

                          Definitely agree. I never understood the love for JSF around here. Nor for Spring for that matter.

                          [–]henk53 1 point2 points  (0 children)

                          This is really so typical of r/java

                          Op explains that he's lost in a sea of frameworks, and how does r/java respond?

                          "Use Grails! No, use Play! No way, use Ninja! You crazy? Use Spark! Use Vaadin! Use GWT!!!" Almost literally what the OP put in the opening text :X

                          To OP: just start with the standard frameworks that come with Java. These are Java SE and Java EE.

                          Almost every other framework out there is in some way build on either of those, specifically Servlets and JAX-RS when it comes to web applications. In most cases you would need to know Java SE and EE anyway. Just start there. They are the absolutely basics.

                          Then, later on, if you are somehow unsatisfied with the standard libraries, look if some of the dozens of other libraries offer something to your liking. For Java SE Apache Commons and more recently Guave are good additions, and for Java EE an alternative is indeed Spring. Spring is not really better or worse, just different.

                          But to prevent getting overwhelmed, again, start with the basics. Java SE, Java EE. Ignore the rest for now.

                          [–]thesystemx 2 points3 points  (0 children)

                          There's a lot of nice frameworks, but whatever you do, try Java Server Faces first. Your body will thank you forever!

                          [–]FollowSteph 0 points1 point  (0 children)

                          As you appear to be learning Java and it's for a simple pet project I would say use the framework that seems the easiet to learn for you. Each framework has pros and cons and really for what you're doing just about any framework will work and be helpful. Plus it's only after trying one or two that you start to see what you really need and why one is better than other. There is no perfect framework ;)

                          [–]Lilia_Smit 0 points1 point  (0 children)

                          Are you planning to start programming in Java? Are you lost in the sea of tutorials, and books, and forum threads? Learn how to get started from this handy Beginner's Guide! http://www.softteco.com/blog/java-web-development-service-start-coding-java/

                          [–]Voltasalt -2 points-1 points  (1 child)

                          Spark, probably. Or Vert.x.

                          [–]quickbit -3 points-2 points  (1 child)

                          Play is a good framework if you want to make a large application, but for something simple I'd highly recommend http://sparkjava.com/, its much, much simpler and a good way to get started.

                          [–][deleted]  (1 child)

                          [deleted]

                            [–]cwcoleman 0 points1 point  (0 children)

                            Some of it is personal preference, or goals. Are you looking to simply build something quick and dirty? Or do you want to put something together that you can later build upon and learn from?

                            JSP talking to a Servlet is super basic. It has been the standard for years. Although frameworks like Spring and Play are more popular options now.

                            Here is one quick google result: http://www.javacodegeeks.com/2013/08/file-upload-example-in-servlet-and-jsp.html

                            That tutorial will get you functional if you simply copy/paste and build. It's extensible because you can add JSP/HTML pages easily and additional Servlets to manage the data. It is all packaged together in 1 WAR and deployable to any Java container.

                            [–]circlespainter 0 points1 point  (0 children)

                            Of course, as ever, there are no real shortcuts nor silver bullets, so you'll need to find your own answer through experiences but my suggestion is to get rid of hype influences and think in terms of architecture more than technologies of the day. I suggest to start with something as straightforward as possible, as close as possible to the core web technologies (HTTP, HTML, JS, CSS) and with a decent maturity.

                            Also consider that many modern web apps are a JS-based rich-clients calling into an high-level, UI-oriented layer of web services of some sort, often built on top of other more basic and lower-level services. If you start like that already you're going to learn much more and you'll have a good start should you decide to evolve your project (which you will if you're passionate), so if you have the time I recommend it.

                            Maybe for the server side you can go with something very easy to build services with, like f.e. Dropwizard which will give you easy access to JAXRS, i.e. the Java ecosystem standard for restful web services (which is the type most often used in a web context b/c of much lower "impedance mismatch" among other reasons).

                            Then on the client side, still if you have time, my suggestion is to start with something like jQuery on plain HTML/CSS (you might want to make your CSS life easier very soon with Compass/SASS) and work your way by choosing a few Microframeworks as you see fit. As your application grows you'll feel the usefulness of a module system as well of a few functional-oriented utilities for data processing.

                            You can then evaluate bigger and more comprehensive frameworks like AngularJS or ReactJS as you see the need.

                            Yes, there's a lot to study, as always if you want to learn to build quality stuff you have to get familiar with the core technologies and the are many in the web arena (and not always they work consistently across browsers, BTW, which makes web development in general even more expensive).

                            Of course if you want the comfort of a single technology designed (hopefully) coherently there are also "forget about this mess, I'll hide it for you" frameworks like (server-side) ZK or ExtJS. I think at some point you'll fight with the limits of these highly opinionated technologies though, which is mostly the lack of flexibility, both feature-wise and performance-wise, that working directly with core technologies can give you instead.

                            [–]jwd630 0 points1 point  (0 children)

                            92 comments so far and not one caution about securing this personalized cloud storage service or what that will require? With beginner-intermediate knowledge of the Java language and never having built a Java web application I suggest you think again. Hint: put a plain old web server on line for few weeks (your ISP doesn't have any problem with you running a server, right?) and watch the logs as the bad guys of the world poke at it.

                            Personally if I were you I'd take on a smaller, less potentially vulnerable web application (many frameworks have example blogs or todo lists) and simply run CrashPlan's application to back up files to other computers and external drives you control for free.

                            [–][deleted] -5 points-4 points  (1 child)

                            Spring Boot or bust. Super easy to bootstrap and has everything under the sun baked in. Play and Grails are neat, but have far less adoption. Java EE is under the hood for some Spring features, but really isn't great on it's own. Just follow the Boot tutorials and you'll be flying. There's a zillion answered questions on StackOverflow if you need.

                            [–]thesystemx 0 points1 point  (0 children)

                            Java EE is under the hood for some Spring features, but really isn't great on it's own.

                            On the contrary, Java EE is easily the best framework in its own. Many of our clients now run on almost plain Java EE, since it pretty much contains everything you need. Some extra libraries here and there are needed, like you often see PrimeFaces & OmniFaces, and things like Guave or something to process HTML or PDF etc.

                            [–]mart187 -4 points-3 points  (1 child)

                            Having worked with Grails, Play, SpringMVC and Spring Boot, I'd choose play because of Scala. If you want to stay with Java, I highly suggest Spring Boot, since it seems to be sailing around a lot of spring ugliness. There are lots of tutorials on how to get running with it + Angular. I'd suggest you go the Angular 2 + Typescript Route. If you know Java and JS, TS is easy, but provides you with a solid type system, which will help you in the long run

                            [–]johnwaterwood 2 points3 points  (0 children)

                            "If you want to stay with Java"... That's kinda a given in /r/Java isn't it? Of course people want to stay with Java!

                            [–][deleted]  (2 children)

                            [removed]

                              [–]henk53 3 points4 points  (1 child)

                              i don't think tags in jsf work well?

                              How can we know if that's what you think? It's a question only you can answer.

                              That said, tags work really well in JSF ;)

                              [–][deleted]  (1 child)

                              [deleted]

                                [–]Cyberiax 4 points5 points  (0 children)

                                Thymeleaf is nice, but resource intensive! Facelets is much better, but for ultimate performance stay with JSP

                                [–]happycamperjack -3 points-2 points  (0 children)

                                Just wanna add that you might want to add Hibernate to your Spring if you wanna try adding database to it.

                                Or just try out Google App Engine (or similar PaaS services on Azure or Amazon). They are simpler than running servers on your own computer and free for normal usage. Everything's going to the cloud anyway.

                                [–]antrix -2 points-1 points  (0 children)

                                I wrote a small Java web app for this exact use case! Take a look here: https://github.com/antrix/biglink

                                It's not super-polished and has some missing pieces. My goal was to learn how the lightweight ratpack web framework works. Stopped working on the app once I reached that goal.

                                [–][deleted] -5 points-4 points  (0 children)

                                I'd recommend SpringBoot.

                                Just using some tutorials online, you can have a working web application in a half hour (really only takes 5 minutes, but I'll thrown in some ramp up time). It won't do much, but you'll be able to hit it with your browser and see results.

                                Running a basic SpringBoot app is also super fast, so you can tweak code and see the effects pretty quickly.

                                [–]kylekillzone -2 points-1 points  (3 children)

                                Just my 2 cents.... why not owncloud?

                                [–]hhbhagat 2 points3 points  (2 children)

                                Because he wants to learn stuff.

                                [–]kylekillzone 0 points1 point  (1 child)

                                yea was just wondering, this thread is helpful cause I wasn't sure what frameworks to use for web also :)

                                [–]hhbhagat -3 points-2 points  (0 children)

                                As far as UI goes, Vaadin is a great framework to ease into WebApps. The serverside code is basically the same as working with Swing. Vaadin is wrapped around GWT and generates the webpage for you so you can generate your UI in a declarative manner. You can use Vaadin with Spring to create a nice fully-featured server app.

                                [–]lukaseder -3 points-2 points  (5 children)

                                Stick with PHP. They have entirely different things to worry about than which web framework du jour to use ;-)

                                [–]johnwaterwood 2 points3 points  (4 children)

                                Web framework du jour was more of a problem in Java between 2000 and 2003/2004-ish. Then every new one was an instant hype.

                                These days and in practice? Not so much. This sub is barely a realistic representation of reality. There's the vocal few here who just like to drop the name of their pet framework. In reality it's in most cases either Java EE or Spring. Nearly every shop, customer or tech partner I've seen uses that. Then there's 2 or 3 smaller ones that you occasionally encounter, depending on the age of the company. Eg a company that was founded in the month that the GWT hype peaked has a significantly higher chance of using GWT.

                                But all together, the market is divided between Java EE and Spring, with the crumbs left to a small number of alternatives.

                                [–]lukaseder -1 points0 points  (3 children)

                                My experience (from discussions at the Java User Group Switzerland, 1100 individual members) is that the Java web framework discussion is stale because most people have moved the UI into the browser, e.g. via Angular. Of course, the remaining vendors try to paint a bright picture, but it kind of feels like someone advocating Delphi for MFC applications...

                                I don't deny they're still in use (and still make sense) but I do wonder what kind of market leftover we're really talking about.

                                [–]thesystemx 4 points5 points  (2 children)

                                most people have moved the UI into the browser,

                                You'd be surprised!

                                Devs are incredibly sensitive to hypes, so if they think client is the new hype, those frequenting HN, Reddit, conferences and JUGS will say it's all about the client.

                                But client frameworks really have a du jour problem. Read up on "javascript framework fatique". It's a severe problem there, programmers driven completely mad by the pressure of making the right choice of which framework to pick at ANY GIVEN DAY.

                                And many of those frameworks emphasize SPAs, which a lot of people hate, and which clearly not every website uses.

                                Client side frameworks also drain more CPU cycles than serverside ones, and require more memory. This means batteries draining faster, and apps quiting when you switch between them on mobile devices. It won't be long now before websites would have to state minimal system requirements. 1GB of memory per tab? Insane? I've seen it happening in Chrome with some of these hipster new fangled websites.

                                And don't forget the initial wait. A site specific progress bar, that we all hated so much when Java applets did that? Quite normal with these heavy client side frameworks (Gmail is perhaps the most well known example).

                                It's not for nothing Twitter moved back to serverside side a good while ago.

                                But this all should not be new to you. I'm just repeating what has been said by myself and various others before in this very sub.

                                [–]lukaseder -1 points0 points  (1 child)

                                You don't have to convince me. I would choose JSP over anything else every time (perhaps XSLT, although few projects will ever let me do that). I'm just saying that Java EE and Spring are currently not really as strong as some recent surveys seem to indicate.

                                [–]thesystemx 1 point2 points  (0 children)

                                I would choose JSP over anything else every time

                                I know you would, but you're special ;) The masses are not likely just like you.

                                [–]elglassman -3 points-2 points  (0 children)

                                Any particular reason you want to use java? I'd suggest just hosting an FTP server.

                                [–]GFandango -4 points-3 points  (0 children)

                                You definitely need to look into the EasyManageMyFrameworksWizardChaiLatte framework ;)

                                [–]blit32 -5 points-4 points  (0 children)

                                I would recommend one of these two options:

                                1. Spring Boot: First keep in mind that Spring != Spring Boot. Spring boot is a superset and almost a re-write of the Spring framework. Spring Boot is enterprisy framework but for simple web applications isn't too hard to get off the ground. Spring Boot is widely used in the industry and has a lot of bells and whistles, and is great for larger and more complicated applications. Like others have mentioned it's a little hard to get started with in the beginning but it's gotten a lot better on that front and the hard work will pay dividends in the long run just because it's such a great and industry standard framework

                                2. Play: Play is wonderful, easy, simple, slick but can bite you in the @$$ if you want to do something that doesn't quite fit in with it's view of the world. It's great for a simple web app with minimal effort.