TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Why are there so few apps being built with JSP?

40 pointsby idleworxalmost 15 years ago
It seems to me that lots of small to medium webapps are built either in php or in ruby on rails. I'm wondering why there seem to be only a small minority of webapps (at least not enterprise ones) being built using JSP technology. Most articles and posts I see on HN seem to be webapps built with other technologies but Java.<p>JSP web apps can be built quickly as well. Eg. you have the JSTL tag library, and orm frameworks such as MyBatis or Hibernate. And there are also other things for simplifying, decoupling and modularizing a webapp like the Tiles framework, Struts, Spring MVC frameworks etc.<p>Now, I know for a fact that there are some other advantages php or rails apps have, particularly the lower price of hosting and possibly smaller memory requirements, but I'm wondering if there are any other reasons that JSP/Servlets/Java based small webapps are such a small minority and why adoption seems to be rather low for small to medium web 2.0 apps.

35 comments

10renalmost 15 years ago
My opinion. It's partly because teams who do webapps tend to be small, young and agile. First, prejudices: they prefer new things (Java is old); they dislike the environment that is Java's home (big enterprise) and the practices and personalities types that go with it (perfectionistic, professional, conservative).<p>Second, real reasons: Java is verbose and statically typed, and therefore it takes more work to make changes - it is slower to develop in and less flexible/agile. These things really count when you want to try out an idea; and when you need to adapt it. There's also a community effect, where all those early adopters are working with Ruby/Python, that's the platform cool stuff gets developed for (eg. sinatra, github, haml).<p>Technically, it's possible to write a sinatra in Java (I have; using annotations for urls); but who would use it? I actually love Java myself, including its static typing, and use it in my startup. But when I've played with Ruby - even as a novice without knowing the tricks - I found it much quicker to develop in, and the code easier to understand because less cluttered. It's probably not as reliable; and the code doesn't run as fast; but these things just don't matter for prototypes and early versions.
评论 #1536648 未加载
iamelgringoalmost 15 years ago
For me, it's purely emotional.<p>My last class at Uni 2 years ago was a survey of web dev technologies. We built sites using ASP.NET, Perl, PHP and JSP. Java and asp.net were tied for worst experience ever. Setup and configuration of the Java stack was 2/3rds of the project. And, that's after taking 2 years of Java in school. Setting up a Java stack on a Ubuntu or a Windows box was equally as painful for me at the time.<p>My experience at school as made me loathe to try anything Java related. And, while I love the idea of the jvm, I have a pretty visceral emotional reaction to anything java related. I know it's wrong, but I can't even bring myself to do the installation required to mess around with Clojure or Scala.<p>I get the same vibe from a number of young developers I come across at Hackers and Founders SV meetups that have recently graduated from school. Someone mentions Java at our meetups and everyone at the table groans.<p>Python and Ruby are essentially lingua franca here in Silicon Valley startup culture, with C and C++ mixed in for speed. I've settled on Python/Django for day to day dev work.<p>In my case, even though Clojure and Scala look really sexy. The thought of installing a jvm based development environment makes me break out into a cold sweat. If I'm going to play around with a "sexy" language to learn stuff I'm going to play with Haskell, Erlang, or O'Caml, just to avoid using the jvm.
评论 #1536320 未加载
评论 #1536147 未加载
评论 #1536040 未加载
评论 #1536963 未加载
mindcrimealmost 15 years ago
From what I've seen/heard, I think the lack of cheap hosting was one of the biggest things that kept Java from catching on as a preferred platform for the kinds of webapps that you see people building with PHP and/or RoR. That problem has, IMO, been mitigated somewhat by the emergence of cheap VPS providers... now hosting is hosting, and what you run on your server is entirely up to you. But by the time cheap VPS's became commonplace, it had become "cool" to hate Java. And, to be fair, there is a little more of a learning curve to get started with Java and most of the Java based webapp stacks, compared to, say, RoR or whatever.<p>Also, to be fair, other platforms have "caught up" to what were some of the early advantages of Java. For example, at one time I would have cited JMS and the easy accessibility of async messaging from Java as a big advantage. But now there are a bazillion messaging systems and most (if not all) of the major ones have easy to use client libraries in Perl, Python, Ruby, etc.<p>OTOH, Groovy/Grails brings a lot of the advantages of a RoR type framework to a JVM based ecosystem, as does Rails on JRuby, so more and more things are evolving to where the various platforms are approaching parity.
roamalmost 15 years ago
I prefer scripting languages over a pure Java stack simply because I can reload the page and see what's happening with the new code. Yes, you can use JRebel, hook up a debugger and tweak settings to get some hot code replacement, but they've always failed me at one point or another, resulting in hours of fun. The compile-check-fix-compile cycle gets under my skin, especially when you're using frameworks and libraries that take a minute to bootstrap.<p>The JSTL is not a factor in speeding up development. A lot of people even prefer a Velocity or Freemarker template engine when they are using Java. And I've never worked with MyBatis but have done plenty of projects with Hibernate/JPA and let me tell you: I've often come at a point in a project where I was wondering how much time I had saved by not writing the easy SQL queries and how much time I had lost by trying to work around some random restriction in the Hibernate API. For all the "hate" Django's ORM gets, I've never run into the same obstacles.<p>With all that said, the Play! framework addresses a lot of these issues and is a lot more fun to work with.
评论 #1536282 未加载
评论 #1535910 未加载
评论 #1535945 未加载
samdkalmost 15 years ago
The biggest problem with Java webapp development, in my opinion, is its ridiculous obsession with XML. I can't count the number of hours I've wasted debugging obscure errors only to discover that I had a minor syntax error in my XML configuration files. In a framework like Rails, 90% of what I have to specify in those XML config files is assumed by default anyway, and almost all of the rest is done as Ruby code, which means I get actually intelligent errors when something is wrong.<p>Basically, it seems to me like Java web development uses XML as a dynamic programming language when they're trying to do something Java's not well-suited for. The issue is that XML has absolutely no type-checking at all, and so you end up with errors that make absolutely no sense when the only issues you have are simple typos.<p>The problem is even worse because you seem to end up having to specify the same information in so many different places, and having mistakes in just one of those will prevent anything from working.<p>I am sure there are ways around this, but the whole point is that if you're using a framework like Rails, you don't need to deal with <i>any</i> of this. It all just works, and having wasted months of time on Java web dev, I want to deal with a system that <i>just works</i>, not a system that requires ten or twenty kludgey three- and four-letter band-aids to get it to behave intelligently.
评论 #1537549 未加载
评论 #1536089 未加载
mark_l_watsonalmost 15 years ago
Although I use Rails for most web apps that I do now, there was a period from about 11 years ago to about 5 years ago that JSP was the sweet spot for me. I would put a lot of embedded Java in JSPs, and as an app matured, I migrated the code to custom tag libraries (easy to write once you have everything working in JSPs).<p>For me part of the lure of JSP apps was that I really liked Tomcat as a development and deployment platform. For apps that needed a lot of background processing, I started work threads in servlet init methods, and liked having everything in one JVM.<p>I had one app running without restart for several years until my customer's admins let the server run out of free disk space. I am not at all confident of a Rails app running for 3 to 4 years with no restarts.<p>To answer your question: I might still choose JSP for high volume web apps. For apps with a modest number of users, Rails makes more sense for me.
lukevalmost 15 years ago
Actually, there are far more apps being built on various Java stacks than the alternatives - it's just that the people using them collect a paycheck and go home at 5 rather than blogging about it. The heavyweight, large business and government market is almost exclusively Java<p>Also, lots of people judge Java frameworks based on monstrosities like J2EE, Struts or Spring. But there are several very nice, truly lightweight Java frameworks, and even more for alternative JVM languages. The Java stack often <i>does</i> suck, but it doesn't <i>have</i> to suck.
narratoralmost 15 years ago
I am a Java developer in my day to day work but I'll give a few reasons:<p>1. The memory footprint of the JVM is significantly larger for a similar app vs. PHP. Also, it requires a lot of tricky JVM option tweaking to get it to work in anything less than about 512mb.<p>2. The build environment is really heavy weight and complicated. Maven seemed crazy at first though working with it for a while finally got me used to it. It's still crazy complicated compared to rails/python.<p>3. Lack of code reloading when you hit refresh. JavaRebel fixes this, for a price.<p>4. Java code is really verbose. You have to become an expert at a lot of IDE features before you can get decent productivity. You absolutely cannot use a simple text editor or anything less than one of the big 3 IDEs (Eclipse, Net Beans, Intellij) and get anywhere.<p>The future is bright though for the JVM. I have started to work more with Scala/Lift lately and I am really blown away at how fast and powerful it is compared to traditional Java development.
评论 #1556826 未加载
Tichyalmost 15 years ago
Just to set up one of the Java frameworks you list is already a lot of work and a lot of wrangling of XML.<p>Without frameworks, it is probably OK if you already have a working web.xml. I used to just copy my working web.xml and modify it. Good luck if you want to create a working web.xml from scratch, though. The specification for a proper web.xml is a PDF with several 100 pages (last time I looked, a couple of years ago), and to parse it you basically need a scanner for XML specification files in your brain.<p>That is only for creating the working web.xml. Specifications for JSP and JSTL are several hundred pages on top of that.
评论 #1535839 未加载
评论 #1535842 未加载
评论 #1535844 未加载
评论 #1535917 未加载
评论 #1536273 未加载
aretealmost 15 years ago
I can't speak for PHP but if you follow the usual Rails conventions for db structure, URL layouts, etc then it takes significantly less time to build (and maintain) a Rails site vs Java EE.<p>Simply collecting all of your Java libraries, frameworks, dependencies, etc and getting them running in your app server can take days. Minor changes like adding a db column can end up touching nearly every layer.<p>All these costs do have benefits. Java ORMs generate much more efficient queries than ActiveRecord, have more flexible querying, and better fit into existing schemas; JSP engines can render tens of thousands of pages per second; Java app servers are easily clustered; and much more. But most of that isn't something small or medium web apps use, so why pay the price?
评论 #1535832 未加载
garyrichardsonalmost 15 years ago
On the low end, I've always thought java has a significant disadvantage: memory footprint. In particular, this is compared to PHP/Perl/RoR/etc.<p>When you start your java app you pre-allocate all the memory you're going to need for the process' lifetime. This could be 512MB, this could be 2GB+, but it's never small. And this is unaffected by your initial traffic volume. It's the same for 0.001 hits/sec or 5 hits/sec.<p>On the other hand, if you drop a bunch of PHP scripts on a server, Apache only uses the memory it needs. Sure, you may have some pain scaling it later, but to get up and running you can get a cheap server and run your code.<p>Also, while I have your attention, have you ever tried installing an enterprise java webapp? It's not like you can pile a bunch of them into one JVM on a machine. I run confluence/jira/bamboo. Each has it's own requirements and basically need to run in their own tomcat servers tuned with their own settings. It's a huge PITA and eats up a ton of memory.
评论 #1535797 未加载
评论 #1536256 未加载
neovivealmost 15 years ago
From my own experience of working with Java/JSP at work and PHP for side projects (I'm also learning Python), it comes down to developer productivity -- rapid application development, deployment speed and developer experience. For most small- to medium-size projects, you can achieve the same results in Java, PHP, Python, Ruby and even ASP, but the journey towards completion varies greatly across languages and tools.<p>IMHO deployment on the Java stack is not as fun. Time spent configuring Tomcat, Ant, and compiling code adds-up, especially for a basic web app or prototype. The Java stack also has a larger learning curve for beginners.<p>However, if you work on "enterprise" applications, especially ERP, finance and banking, Java is currently the lingua franca.
评论 #1535898 未加载
jefftalmost 15 years ago
IMHO the answer is here in this thread... which would you choose?<p>a) php b) rails c) Java + JSP/Servlets/JSTL/Tiles/Struts/Spring/JSF/Play/Wicket/GWT/Stripes/Tapestry/WebObjects
评论 #1541468 未加载
jedwhitealmost 15 years ago
Try out Google App Engine's Java support and the Eclipse plug-in, and if you're after a Java framework check out GWT.<p>I love Python and work in it almost entirely now, but previously worked with Java (yes I know the joke about them being the same with the whitespace re-arranged).<p>GAE gets rid of most of the configuration and scaling pain. Plus it's free to get started. There are some limitations, but essentially it makes deploying Java web apps a snap.<p><a href="http://code.google.com/appengine/docs/java/overview.html" rel="nofollow">http://code.google.com/appengine/docs/java/overview.html</a>
评论 #1539471 未加载
rryyanalmost 15 years ago
I think Java and its plethora of frameworks makes new developers feel overwhelmed. Python clearly has Django, Ruby clearly has Rails, Java has... what? Struts? Spring? Tiles? Servlets? JSPs? Tag libraries? Where do you start?<p>To an outsider, it feels like there is a mountain of material to wade through before you can really get going with a Java webapp; for Python and Ruby, the perceived barrier to entry is much lower.
评论 #1536724 未加载
paolomaffeialmost 15 years ago
It takes you 10 periods of time in JSP to do what you can do in PHP in 1 period of time.
评论 #1556855 未加载
smitjelalmost 15 years ago
You're asking this question on a site that is "startup focused" which means they aren't going to have a team of 20 developers churning out java byte code...they're going to be using more modern, dynamic languages like Python and Ruby because the popular full-stack frameworks that are behind Python and Ruby are better suited to get ideas off the ground as opposed to the monolithic JEE stack.
tzsalmost 15 years ago
I used to write desktop apps and also do drivers and VxDs for Windows. One of the things I strongly disliked about that work is that you are working in an environment where there is a huge amount of infrastructure that you are intimately dependent upon and that is hidden from you.<p>Java brings that kind of thing to the server, and I want no part of it.
评论 #1536331 未加载
tomjen3almost 15 years ago
Because it is an abomination - it has less power than most of the other template frameworks available for Python and Ruby, and the tag libraries require mountains of XML if you want to write your own.<p>Now the basic servlet idea is pretty damn nice, and once you have your code written final deployment isn't that bad.
dkberktasalmost 15 years ago
-steep learning curve compared to rails, django, grails, etc - lots of configuration (I mean a lot, no convention over configuration) - application servers are not easy, tomcat can be a nightmare in term of rapid deployment/undeploy routines, just think about heroku on the other hand
评论 #1556857 未加载
sethgalmost 15 years ago
One can make a case that when a team of developers uses JSP in the context of the entire Java EE stack, it gets certain advantages that outweigh the overhead of developing and maintaining all of JEE’s moving parts. My last experience with JEE was pretty horrific (portlets! Java Faces! madness!), so I am not eager to try this again, but at least an argument can be made in favor of JEE for certain applications.<p>If you take away the rest of the stack and are just using JSPs... why bother? I have found a certain comfort zone using Django and I’m not going to switch to a different framework or language just because it’s <i>possible</i>; I would want to know why that alternative gives me a <i>significant advantage</i> over what I’m doing now.
sqrt17almost 15 years ago
Actually, you can code very nice lightweight apps using an embedded servlet container like Jetty, a JSP library, and an ORM (MyBatis or Hibernate). Which is kind of like the idea of a microframework.<p>I've used it for a demo I've made (some NLP stuff in Java that needed a web frontend, but where running it under Tomcat would have been like the tail wagging the dog) and it worked quite well.<p>I guess that all the people who want a microframework to get small things done efficiently have moved away from Java at this point, appalled by the whole J2EE circus. And once you have something as elaborate as the J2EE stack as it's meant to be, JSPs are not a good fit, because they don't enforce a separation between presentation and business logic.
grandalfalmost 15 years ago
I find javadoc very ugly and annoying to look at. Dumb reason, I know but I can't get past it.
评论 #1536110 未加载
niravalmost 15 years ago
Three reasons I can think of, in order of time to get things done:<p>1. Availability, ease of use of Java based hosting provider<p>2. Time from writing code to live deployments<p>3. Lack of agile frameworks like rails, django or any other php framework (hot code reload etc.).
naos_plalmost 15 years ago
I moved all my webapp development from java to python+django. What I observed is: - I code webapps much faster now - I produce a lot less lines of codes - Testing is so much faster due to uncomparable faster deployment time on development server - Templating engine is more clear - Configuration is faster, everything in one file, no sucky XMLs! - Python is easier to read and so fun to code<p>Ultimately I feel now that moving from PHP to Java was a step backward, and I feel like now I made a big step forward by moving to Django.
kp212almost 15 years ago
I know that Fleaflicker which was posted here was a java based app. So they are out there, but I think more of them are from the 2000-2003 time frame. Has anyone here gone from the Java Stack to RoR? What would you recommend to anyone making that transition? I want to make my next project a "learn a new lang" web project. I fairly strong understanding of the Java MVC(Spring, Struts 1), and DB transactional frameworks(Spring JDBC, Hibernate) and wonder what I should be reading for a transition?
toastralmost 15 years ago
Here's why (and I'm flammable):<p>Because it sucks. Seriously. I don't want another bloated framework like tiles, struts or even Spring MVC (and yes, I know it's the 'less bloated' framework).<p>You know what the best user interface is for Java apps? XML, JSON or Java. You know what the best framework is for a webapp? Me either, but it better fucking be html, css and javascript.<p>It's not rocket science. For fucks sake if I wanted a framework for my front end I'd use the native language.
msencenbalmost 15 years ago
I can't speak for everyone but the reasoning behind my choice of php is 3 fold 1) Ease of set-up 2) I'm simply more comfortable with php 3) Better online resources / documentation<p>In the end it came down to picking a language I was comfortable in and could start moving forward the fastest with.
kdonaldalmost 15 years ago
If you want to see what Spring MVC brings to the table, checkout the following showcase:<p><a href="http://blog.springsource.com/2010/07/22/spring-mvc-3-showcase" rel="nofollow">http://blog.springsource.com/2010/07/22/spring-mvc-3-showcas...</a>
thenduksalmost 15 years ago
A few major reasons:<p>- The verbosity of Java wears on me very quickly.<p>- I can't stand working in an IDE.<p>- Documentation is abysmal.<p>- I'm not familiar with the ecosystem (so I don't know what to use and when -- What's 'Struts'? What's 'Tiles'?) and there doesn't seem to be a place to learn.
评论 #1536312 未加载
评论 #1536153 未加载
noodlealmost 15 years ago
i do java at work, and ruby/python/php at home. for me, its simple.<p>java and its frameworks are too bureaucratic. getting things done requires too much. in an enterprise environment with lots of developers, this is good. in an agile, rapid development type of environment with a small handful of people, this is bad.<p>the closest thing that i've come across that made me want to consider java apps development is grails.
keefealmost 15 years ago
My server is in java and I hate jsp's. I prefer rest with json and a thickish client. imho jsps muddy mvc design.
iCrusaderalmost 15 years ago
Lack of easy and cheap hosting is one big reason for small to medium web apps. That is what i think.
ww520almost 15 years ago
It's the competency barrier.
drivebyacct2almost 15 years ago
I actually have come to enjoy java servers/services this summer at my internship, but there is no way in hell I'll ever do anything with JSP, ever.
评论 #1538069 未加载