Django like framework for Java [closed]
Asked Answered
S

7

27

I am a Java developer. Is there some Django/Ruby-on-Rails kind of framework for Java? I don't like to create the admin panel for each project I do. It's boring to do the same thing again and again. Also for my new project I have a short deadline and I would like to use some kind of Java framework that speeds up development.

Susurration answered 9/2, 2010 at 7:0 Comment(0)
L
15

Recently I found a framework which looked very much like django. It's called playframework and you can find it here:

http://playframework.org/

I suggest you watch the video on the front page.

Another Java based django-like framework is Spring Roo, but in my opinion it's not quite ready. Last time I used it the documentation was virtually non-existent.

http://www.springsource.org/roo

Lakeesha answered 9/2, 2010 at 7:5 Comment(3)
thanks for replying.Can a application devloped using play run on tomcat??Susurration
As far as I know you can package all your files into a .war which then can be deployed on a tomcat server. But there is no really need for that. You can simply use the integrated server and just use http proxy like nginx/lighty in front of that.Lakeesha
Thanaks again.I have to deplop the application on a shared server from a third party.The third party wont allow me to run the integrated server i guess.Susurration
M
23

Take a look at LightAdmin pluggable administration interface for Spring/JPA-backed web applications.

Usually, in web application development, you need to have some kind of administration back-end with usable UI and it's boring to develop it from scratch all the time and maintain it in the future.

Personally, I solved this for my Java projects by simply plugging LightAdmin library and doing some customizations from DSL configurations.

All you need to do is to declare Maven dependency & enable administration panel in your web.xml. Right after this you'll have a feature-rich UI with complete CRUD support, filtering, scopes, security, etc.

LightAdmin's DSL for admin panel customization example:

@Administration( Booking.class )
public class BookingAdministration {

public static ScopesConfigurationUnit scopes( final ScopesConfigurationUnitBuilder scopeBuilder ) {
    return scopeBuilder
        .scope( "All", all() )
        .scope( "Smoking Apartments", specification( smokingApartmentsSpec( true ) ) )
        .scope( "Non Smoking Apartments", specification( smokingApartmentsSpec( false ) ) )
        .scope( "Long-term bookings", filter( longTermBookingPredicate() ) ).defaultScope().build();
}

public static FiltersConfigurationUnit filters( final FiltersConfigurationUnitBuilder filterBuilder ) {
    return filterBuilder
        .filter( "Customer", "user" )
        .filter( "Booked Hotel", "hotel" )
        .filter( "Check-In Date", "checkinDate" ).build();
}

public static FieldSetConfigurationUnit listView( final FieldSetConfigurationUnitBuilder fragmentBuilder ) {
    return fragmentBuilder
        .field( "user" ).caption( "Customer" )
        .field( "hotel" ).caption( "Hotel" )
        .field( "checkinDate" ).caption( "Check-In Date" )
        .field( "smoking" ).caption( "Smoking" )
        .field( "beds" ).caption( "Beds" )
        .build();
}

public static DomainTypePredicate<Booking> longTermBookingPredicate() {
    return new DomainTypePredicate<Booking>() {
        @Override
        public boolean apply( final Booking booking ) {
            return booking.getNights() > 20;
        }
    };
}

public static DomainTypeSpecification<Booking> smokingApartmentsSpec( final boolean isSmokingApartment ) {
    return new DomainTypeSpecification<Booking>() {
        @Override
        public Predicate toPredicate( final Root<Booking> root, final CriteriaQuery<?> query, final CriteriaBuilder cb ) {
            return cb.equal( root.get( "smoking" ), isSmokingApartment );
        }
    };
}

}
Merrifield answered 13/7, 2013 at 22:50 Comment(2)
you should note that you are the main author. Although this is public information available via the lightadmin contributors page, I think it does not reduce the value of your answer (I upvoted it).Turnstone
Unfortunately, this is not developed anymore, and it breaks completely a Spring Boot application.Telecommunication
L
15

Recently I found a framework which looked very much like django. It's called playframework and you can find it here:

http://playframework.org/

I suggest you watch the video on the front page.

Another Java based django-like framework is Spring Roo, but in my opinion it's not quite ready. Last time I used it the documentation was virtually non-existent.

http://www.springsource.org/roo

Lakeesha answered 9/2, 2010 at 7:5 Comment(3)
thanks for replying.Can a application devloped using play run on tomcat??Susurration
As far as I know you can package all your files into a .war which then can be deployed on a tomcat server. But there is no really need for that. You can simply use the integrated server and just use http proxy like nginx/lighty in front of that.Lakeesha
Thanaks again.I have to deplop the application on a shared server from a third party.The third party wont allow me to run the integrated server i guess.Susurration
D
12

Also for my new project i have a short deadline and i would like to use some kind of java framework that speeds development.

I would be cautious about doing a project with a short deadline using a framework that I am not familiar with. It sounds like a recipe for deadline overruns. Stick with technology that you are already familiar with ... and wait for a project with more relaxed deadlines where you can afford the time to make a few mistakes.

Doyle answered 9/2, 2010 at 10:38 Comment(0)
S
6

Django can be run in jvm using jython, more information here http://docs.djangoproject.com/en/dev/howto/jython/

Subcartilaginous answered 9/2, 2010 at 7:5 Comment(0)
C
5

Have a look at JHipster. Why is it good?

  • Generate bootstrap based GUI interface.
  • Client side code generated is base on nodejs and AngularJs
  • Server side code generated is based on Spring boot
  • Unit test and integration tests are automatically generated.
  • You have a wide range of choices regarding client side and server side frameworks.

These points mean, you will build your development on state of the art toolset and frameworks. JHipster is much more than this, have a look at: https://jhipster.github.io/

Carryingon answered 27/5, 2017 at 14:30 Comment(0)
M
4

Look into Grails:

http://www.grails.org/

Macready answered 9/2, 2010 at 7:3 Comment(1)
Comment flagged as non-constructive.Macready
D
1

You can try also Spring Framework or Play Framework, if you want to code in Java for the Web. To generate the GUI, you can use Vaadin

Here are some of my sample projects in Spring (I've used only Spring so far and it seems to work well for what I want to do):

You can also automatically generate getters/setters based on the fields you have in your classes using Project Lombok. I use that too in my projects, it helps me to write less code and focus on the main problems I have to solve using my coding skills (If I want to add custom code in the methods I generated automatically, I can write them later as I need).

Dandelion answered 19/6, 2017 at 9:1 Comment(2)
At least add some links, lets help each other out.Intracranial
Please read this how-to-answer and follow the guideline there to provide quality answer.Superstar

© 2022 - 2024 — McMap. All rights reserved.