Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I don't know if I should continue the other post of mine because this is a different question. But the questions are related.
I am looking for web java framework that:
1. will be MVC framework.
2. will be well documented.
3. will allow me use javascript of my own without using the framework modules.
4. will support feature like masterpage in asp.net.
5. will have the ability to create predefined components and use them wherever I need.
Is there something like this?
I appriciate very much examples for those features.
Judging by the tags you chose, it all points to:
Spring Web MVC framework
In my opinion it also satisfies your 5 requirements.
I would recommend using Spring Roo to generate your first project. Roo projects use the technologies that Ralph recommends:
JSPX, with some preconfigured tagx files
Tiles as templating framework
Roo will also setup Hibernate with Mysql, which are the technologies you mentioned in your other post
I can't speak to #4, because I don't know masterpage, but Spring MVC satisfies the other four requirements. I'd recommend it highly.
Be warned that Spring has an MVC framework, but it's much, much more. It's a three-legged stool:
Dependency injection and IoC
Aspect oriented programming AOP
Modules like MVC, persistence with JDBC and ORM, messaging, remoting, security, etc.
I would recommend this setup:
Spring (Spring Core and Spring MVC),
Tiles,
JSPX (the X markes the spot)
Tiles for "support feature like masterpage in asp.net."
JSPX, because you can easyly write Tagx files to define your predefined components.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I am studying Java EE technology. I noticed that JSF is an available choice for developing web application. But is it the only choice if I wanna use Java EE tech?
You have numerous Choices when it comes to choosing Web Application Frameworks, depending upon your choice you select one.
You can go for no framework too, but it would be like ending up with complex designs that even yourself won't be able to understand later.
JSF, Netty, Seam, Sitemesh, Spark, Spring MVC, Stripes, Struts, VRaptor, Wicket are some of the examples you can go for.
With JSF, you have navigational framework, MVC framework and RichFaces/IceFaces for front-end. With others, you have navigation and mvc too, and you can use jQuery for front-end.
When it comes to using Databases, transactions, etc. You will have to make another choice between persistence implementations i.e. JPA, EJB3.0 JPA Implementation, Hibernate, Spring with Hibernate and MVC and IoC.
so.. long story short, you need to read.
JSF is only one of the Front-End solutions. There are too many to enumerate.
There are differences between they, advantages and disadvantages.
Other Javascript based UI is GWT.
You can have non Javascript based ones: JSP or even just servlet for a "Hello word"
You can use frameworks which will have the MVC pattern embedded: Struts, Spring.
For start learning: I would choose a framework free implementation - to learn what is implemented later in different frameworks. Just a plain JSP pages written manually.
Later on production, bigger J2EE, which will require more team members, higher speed of development, you can choose a framework, which the project needs and most of developers know.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am currently creating a some DAO in Java. But the application is not very large, so I am not consider to use hibernate or JPA. What light-weight framework can I use??
Thank :D
Neither Hibernate nor JPA would be what I would call "lightweight".
I'd recommend Spring JDBC template or iBatis. Or just straight JDBC. How hard can it be?
If you don't have a solid object model, no ORM solution will help you. The "O" stands for "object".
If you know SQL well and want to think in terms of relations, I'd say that ORM is a bad choice.
Take a look at ormLite. It's intended to be a lightweight ORM tool, but if I'm completely honest, I'd take duffymo's advice an just go Spring JDBC.
The lightest solution - in terms of setup - would be Eclipselink (which is a JPA implementation). Using Hibernate would yield identical code (because it is a JPA implementation too), but would require more dependencies.
To use Eclipselink you just need three jars in your classpath and a very short configuration file (META-INF/persistence.xml). The simplest way to see which jars exactly would be to use Netbeans and add them using libraries->add->eclipselink (jpa 2.1).
No matter which solution you choose you also need a relevant JDBC driver.
If you are a beginner, a JPA library (like Eclipselink or Hibernate JPA) is a good choice because:
your IDE will probably have some tooling to help you with persistence.xml and mapping;
it is a very popular standard and programmers generally agree that it's good;
it let's you do simple things very easily; bootstrapping is one line of code, configuring a simple class can be done in just two annotations;
it let's you grow: when you want to use Java EE stack one day, it will be good to know JPA.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I need to develop a lightweight web application, it will:
have a simple webgui for administrator to operate;
have interface to invoke background existing modules for functionality implement, let's assume it has shell invoke interface firstly, it is not clear yet.
so my question is do we have any popular and recommendatory lightweight java web application framework? one of my candidate is jboss, do we have the recommendatory jboss version?
we ever done a similar work which use python/flask, i just want to see if any other appropriate java framework.
thanks,
Emre
Take a look at the Play Framework.
If you are not sure, maybe this great answer on question "What is pro and contra of using Play Framework?" may help you.
For a lightweight Python web framework it's hard to beat Flask:
http://flask.pocoo.org/
take a look at apache stripes.
It is lightweight web application framework on the basis of Java5.0 and COC.
you can fastly develop web applications and u will have less maintenance work.
Spring MVC 3 is in my experience the
most flexible
extensible and
speedy web framework around
Spring's main purpose was to introduce Dependency Injection for objects.
Another Java lightweight MVC frameworks is Wicket.
Stripes framework
Lightweight
Action based
Convention over configuration approach
No XML
Smart and fun to use
Much positive feedback (search on SO)
Wonder why Struts has not found place in above list ? Is it too heavy ?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
As I had written in title, I am trying to learn Spring 3.0 (I already know Django, Pylons and few simpler MVC frameworks) and try to use Cassandra as a backend for my web application.
Are there any real world examples of doing this? Or maybe some tutorials? I know about the existence of documentation of both technologies, yet I am looking for something "faster" to read and get me rolling.
I'm the author of Hector https://github.com/rantav/hector, the leading java client for cassandra so I would encourage you to have a look at what it has to offer.
While I personally have not been using hector with spring, we did get a few contributions which added spring support. See for example https://github.com/rantav/hector/blob/master/core/src/test/resources/cassandra-context-test-v2.xml and https://github.com/rantav/hector/blob/master/core/src/test/resources/cassandra-context-test-v2-new.xml
If you are already familiar with MVC frameworks then you should be aware that which database/datastore you use in the backend shouldn't impact your MVC application as a whole, or how you structure things - it should only affect your data layer and how it retrieves data.
With Spring MVC, the accepted practice is that you represent your data model as a series of "domain model / classes", which are typically just POJOs to hold your data. "Domain" here means that it is related to your problem domain; so if you have an application which deals with customers ordering things you'd want to have a Customer class, an Order class, etc.
Each of the three layers of your MVC application - the controllers, the service/business logic layer, and the DAO layer interacts with these domain model classes. Since the DAO layer is responsible for retrieving or updating this data in the backend, this means it is the DAO layer which needs to know how to fetch your Customer or Order class from Cassandra, how to update certain Customer fields, etc.
So there is nothing special about how you would build your Spring MVC application itself when using Cassandra or any other "NoSQL" database. You'll just need to provide different implementations of your DAO classes which can communicate with Cassandra.
If you are asking if there are any pre-built Spring utilities that can access Cassandra (or Thrift) then the answer is no, at least as far as what's in Spring 3.0. But this should be pretty simple to write once you have the DAO interface set and all other layers of your application in place.
AFAIK there is no "public" tutorial or example covering Spring (3.0) in conjunction with Cassandra.
So maybe you could look into it :)
I would recommend to start looking at the "template" terminology in Spring (e.g JDBCTemplate and HibernateTemplate) and create something like a "CassandraTemplate".
I don't think there is any cassandra-spring library available. However, you could use Spring to instantiate and configure the bean that talks to Cassandra, and inject that into any other bean you have that requires persistence. That way you can let it benefit from Inversion Of Control and all the facilities the Spring ApplicationContext offers.
That way you can separate the code that is aware of the cassandra datastore from your business logic and use spring.
So, your component that talks to Cassandra will be of the [#Repository][1] stereotype, e.g. it is a Repository, just like a repository that talks, for instance to a JDBC datasource.
I am involved with a project using Spring with Cassandra called Easy Cassandra. A sample is provided here:
https://weblogs.java.net/blog/otaviojava/archive/2013/08/25/run-cassandra-spring-data
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Do you know a site that offers a tutorial with sample source code for a 3-tier application (the usual data access layer, business layer and UI layer)?
The simple, readable and intuitive the source code. Best practices that are applied to the code are welcome as well.
Take a look at Appfuse , it's a quick-starter for java web application, provided with different frameworks : Tapestry , Spring MVC / Struts2 /JSF + Hibernate / Hibatis. It's based on a Maven build, all basic configurations done for you...
One of the few 'realistic' sample that come to my mind...
Another one is the Petstore application from sun, and looking for 'petstore download' on Google, you can find stuff that seems interesting (to me anyway, i didn't give it a look :-), like this spring petstore, "an Ajax based application with DWR, Spring and Hibernate"...
Yes, have a look at the Spring MVC step by step example. It's very clear.
The sample application I'm aware of are the following:
The famous Java Pet Store from Sun. In the version I've downloaded, it used a wide range of Java EE technologies, but it didn't use any modern MVC framework.
From the Spring project you have several applications: JPetStore, Pet Clinic and more. All come with the spring download.
The Seam framework has an Hotel Booking application
You can also have a look at the 3 tier open source applications such as Liferay, but bare in mind that they may by very large. I'm not familiar with any that I can recommend, so please google for CRM/ERP/Protals etc. (sourceforge and freshmeat.net might be good sources as well)
Although it is backed by a CMS and not database, Artifactory may also serve as a good example.
Hope these help.