5 ms·
Ask HN:from your experience choosing Java as web technology?
Hello all
Im thinking about web technology to use in my further web application
I know Java very well and I know c++ very well I know java well enable me fast development
But I know Java is resource hangry , and as single developer that probably will need to pay for web hosting
Im a afraid, this will cost be fortune because using Java.
Is my fear is justified
- ifesdjeen 16y agoI like Java, but more than that i like JVM itself. From my experience, Scala works just perfectly for high-load data processing and frequent calls, serving critical data. Groovy / Grails is a great thing, as for me too. You get a JVM and a whole lot of Java Libraries accessible from Groovy code, but also dynamic typing and, more or less, lightweight framework. That's if you're already familiar with Java. I think that it's going to be pretty easy for you. There're way more things laying around, such as JRuby that runs on JVM. But that all highly depends on what you're going to develop, or what tools you're most familiar with...
- starkfist 16y agoNo.
- towndrunk 16y agoI have been using JSF 2.0 with Tomcat for some personal projects and it's pretty nice. Using JSF you can quickly prototype things and the EL makes it simple to tie your java code (beans) to the web page (jsp). With JSF 2.0 the faces-config.xml is gone and you just use annotations which has really simplified the whole JSF experience. Edit: I should also add that JSF 2.0 makes ajax simple.
- papaf 16y agoNginx (static content + page caching) and Jetty make a good pair on a virtual server. H2 is a fast and lightweight database server and can also go on the same VS. I've had no problems with this technology stack at all - it should be fine until you get such a load that you can afford to upgrade your server setup. My personal bias is to stay away from frameworks and use JDBC and a text templating library. I would also stay away from most frameworks. Both the Play and Wicket groups have posts from people wondering where their memory has gone to.
- umen 16y agohi few questions if i may : 1.how do you set Nginex to foreword to the servlet container in Apache i used mod_jk 2.what are text templating ? 3.what are Play and Wicket groups? 4.is jetty really better then tomcat?
- kls 16y agoJava web technologies are a mess. I finally gave up using JSP / Tiles / Sruts / JSF and started using HTML / CSS / JavaScript communicating to JSON services that I write using JAX-RS. After doing that my productivity went through the roof and would say it is comparable to ROR or PHP. I can rapidly prototype interfaces and then build the services to back them. The Java web technologies are a huge over-engineered time sink, the good part is there is really no need for them anymore.
- umen 16y agohi this sounds very interesting can you give more info about your setup i never liked JSF/Sruts/Tiles
- kls 16y agoIt is actually pretty easy, If I am doing a multi-page site, I tend to use a CMS to do all of my static page templating and export them out as static pages onto the webserver. Then any dynamic stuff I build as widgets with either Dojo or jQuery depending on how complex the site it. Both toolkits have API's for calling JSON services and building UI widgets, but Dojo provides a more robust API for developing complex applications. I usually create a Javascript file per-page that is outside of the frameworks that I call "pagename"_controller.js I put all of the controller code in this file and general make it procedural. So this file will put widgets on the page, glue communication between widgets, and generally act as the view controller for that page. The controllers as wells as the server side services, I generally develop internally, because they require the most application knowledge. But if it is a huge product, I usually define the requirements for the widgets and sub them out. The nice part is in the end, the pages are pure HTML, CSS and all of the Javascript is external to the HTML and CSS so it allows the designers to work in a pure technology that they are comfortable with. It also allows me to sub out work very easily because all of the technologies are well encapsulated. I can sub out a widget by just defining the requirements for that widget and the input and output calls. They do not need to understand the whole system rather just their box. As well my designers are able to take those widgets and drop them on the page and I am able to wire it all up. It is very clean, while maintaining the ability to rapidly develop and application. Finally, I use JAX-RS and JPA to build server side services. This part is pretty straight forward as JAX-RS provides all of the marshaling and unmarshaling of objects as well as all of the web API's for things like grabbing cookies and security.