Page 1 of 1

Spring Java configuration / With/without Thymleaf /

Posted: Tue May 14, 2013 3:31 am
by Sambhav
1. Using Spring Java configuration instead of XML where possible. This is easier to develop with.
2. Option to choose Thymleaf or plain JSP + Apache Tiles in view layer.
3. In build support for OpenId/ Facbook / Twitter login.

Re: Spring Java configuration / With/without Thymleaf /

Posted: Tue May 14, 2013 11:11 am
by phillipuniverse
1. Using Spring Java configuration instead of XML where possible. This is easier to develop with.


Nothing prevents you in your own application from using Spring annotations and picking those up with a component scan. We use them extensively in Broadleaf. The only exception is that if you want to override Broadleaf beans then you have to do that within XML. This is a Spring restriction.

2. Option to choose Thymleaf or plain JSP + Apache Tiles in view layer.


You could theoretically do this but we strongly, strongly advise against this. Currently, switching the view layer from Thymeleaf to JSPs won't be too much of a headache but in subsequent versions it will be more and more difficult as we grow more dependent on Thymeleaf.

3. In build support for OpenId/ Facbook / Twitter login.


We already have this integration. See http://www.broadleafcommerce.com/post/w ... ing-social for more information.

Re: Spring Java configuration / With/without Thymleaf /

Posted: Wed May 15, 2013 9:38 am
by jfridye
To build on the response about using JSP instead of Thymeleaf above:

As you know, Broadleaf comes with Thymeleaf configured out of the box. This decision was not made lightly, as we carefully evaluated and chose Thymeleaf (vs JSP and others). However, many who have used Broadleaf Commerce for their eCommerce platform have chosen other templating technologies (JSP, Mustache, etc.).

If you were to use a different templating technology, the main feature you would forego would be the custom Thymeleaf processors we have written (think custom JSP tags, ore useful utilities). These provide you benefits such as displaying the price on a page, or rewriting form tags to include CSRF protection. Of course these can be re-written as JSP tags, but this is not something we provide out of the box or support. There are other dependencies as well, such as what our BroadleafThymeleafViewResolver provides, that would have to be considered.

Re: Spring Java configuration / With/without Thymleaf /

Posted: Sat May 18, 2013 9:50 am
by Sambhav
Thanks phillipuniverse and jfridye for your responses.

1.
Using Spring Java configuration instead of XML where possible. This is easier to develop with.


Yes you are right. We can anytime choose our Spring flavour to use. Just for clarity, I meant using @Enable* & @Beans annotations.
Like @EnableWebMvc, @EnableJpaRepositories, @EnableTransactionManagement ...

(Just in case you want to see a sample: git clone https://kumarsambhavjain@bitbucket.org/ ... config.git)

(For Spring Secuirty java configuration, its under development . https://github.com/SpringSource/spring-security- javaconfig/)

Somehow Java config look more natural and eye pleasant to me. (Totally my opinion).

@EnableJpaRepositories - Though I have not explored code for BLC 3 yet, if not used, Spring Data provides CRUD / Paging operation on the Entities out of the box. .Similiar to what GORM provides. Might help reducing some code.


2. Option to choose Thymleaf or plain JSP + Apache Tiles in view layer.


I think I will try to live with Thymleaf for now to avoid the re-work. I am just a newbie and need a lot of motivation before learning some new framework :-).
Somehow I am not that convinced to learn it just because it allows you to create .html files instead of .jsp which can be opened like raw html file in browser. That also won't always get displayed correctly with styling/ layout. And my UI guy is still gonna provide me the plain HTML - without thymleaf. At end of day I do have to play with view layer.

Also, to make use of any other tag library (e.g Spring Security tags, recaptcha, XYZ..), you got to create your own dialect.
(Yes, Thymleaf has provided one for Spring Security - http://www.thymeleaf.org/springsecurity.html).

Looks like a little re-work to me :-p (Again, totally my opinion)

3. In build support for OpenId/ Facbook / Twitter login.


Thanks for the URL. I will try to follow the steps and integrate it at my end. Just to confirm with you, I downloaded 2.2.0-GA version 5 days back. It does not have dependencies for Spring Social in POM.xml (hence I believe its not integrated). Is Spring Social integration not part of offcial release version?



Thanks a lot.
Keep up the great work.

Re: Spring Java configuration / With/without Thymleaf /

Posted: Mon May 20, 2013 9:25 am
by jfridye
Is Spring Social integration not part of offcial release version?


It is, but Broadleaf does not include the dependencies for each social network, as not every implementation will need to include Twitter, Facebook, LinkedIn, etc.

Re: Spring Java configuration / With/without Thymleaf /

Posted: Tue Jun 04, 2013 8:39 am
by RapidTransit
phillipuniverse wrote:
2. Option to choose Thymleaf or plain JSP + Apache Tiles in view layer.


You could theoretically do this but we strongly, strongly advise against this. Currently, switching the view layer from Thymeleaf to JSPs won't be too much of a headache but in subsequent versions it will be more and more difficult as we grow more dependent on Thymeleaf.



Will we still be able to? I prefer Jade (I think it came from Node?), I used it with PHP, saved me a lot of time, currently implementing it right now

Example

Code: Select all

!!! 5
html
    head
        title = My Title
    body
        .container


Outputs:

Code: Select all

<!DOCTYPE html>
<html>
    <head>
        <title>My Title</title>
    </head>
    <body>
        <div class="container">
            ....
        </div>
    <body>
</html>

Re: Spring Java configuration / With/without Thymleaf /

Posted: Tue Jun 04, 2013 11:47 am
by phillipuniverse
Haven't seen Jade before. This looks a lot like HAML from Ruby-land.

It doesn't appear that Jade has an idea of Thymeleaf Processors (equivalent to JSP Taglibs) which we rely on a lot at Broadleaf. I guess you could technically get the same functionality without them, but it's a little kluge as you'll have to manually add those items (like structured content) to the model yourself whenever you want to use it.

Re: Spring Java configuration / With/without Thymleaf /

Posted: Tue Jun 04, 2013 12:28 pm
by RapidTransit
Jade is a bit shorter than Haml, I think I did a search for "Haml without percent signs" in Google :lol: and what do you know IntelliJ supports it , my main concern is that there is going to be a larger dependency on Thymleaf

You could theoretically do this but we strongly, strongly advise against this. Currently, switching the view layer from Thymeleaf to JSPs won't be too much of a headache but in subsequent versions it will be more and more difficult as we grow more dependent on Thymeleaf.


There is also an equivalent to the Thymeleaf processors, that was the first thing I checked.

Re: Spring Java configuration / With/without Thymleaf /

Posted: Mon Oct 13, 2014 5:02 am
by Raza159
Broadleaf does not provide any support for this out of the box. However, Broadleaf uses Spring Security so it might be easier to tailor your search towards integrating your forum software with spring security in general.