Choosing Presentation layer for spring application? - user-interface

i was using JSP and YUI with spring applications
and i want to use a new presentation layer like IceFaces or GWT or any other good one
but i am confused what to choose
i need to make a good looking view, and the technology must have a good support/samples, and easy to use, commonly used with spring, please advise, thanks.

I don't have enough experience in IceFaces, but GWT is really easy, rapid and full ajaxian. Also the SEO issues can be handled in GWT.

Although a bit old, check out:-
http://woork.blogspot.com/2009/01/10-beautiful-web-ui-libraries.html

Related

Spring MVC view technology: what to choose?

I want to create web-site with Spring back-end, but I can't choose what view technology to use: JSP, Velocity, or I should try to integrate JSF with my app. Which of this technologies is the most popular?
Looks like that JSP is a quite deprecated technology, but I hasn't found a proof of this thesis yet. Should I learn JSP, or try some another framework?
I´d use JSP+JSTL+Tiles, but mainly because everybody knows them. I could consider to use Freemarker or Velocity (Specially the first). However, I think Spring MVC and JSF are technologies that overlap, and using them together could be useless and dangerous.
I recommend you to take a look at this: http://docs.spring.io/autorepo/docs/spring/3.2.x/spring-framework-reference/html/view.html
And also at this: http://ihatejsf.com/

What the difference between struts2 and spring MVC

I am learning Java EE and wanna build up a complete management system for a restaurant. Now I am confused what presentation layer should I use for my RMS because I heard that the struts 2 is one of the best UI layer but, the thing is, if I am using spring for my business logic layer then I can use the spring MVC can't I? By the way, I am really interested to build a complete application which is follow the multi-tier architecture.
Yes, of course you can use Spring MVC.
You can use Struts 2 if you'd like as well, because Spring integrates with it nicely.
But I don't see any reason why you'd want to do that. The person who told you that Struts 2 is
one of the best UI layer [sic]
is misguided. If you compare it to Spring MVC, you'll see that the two are based on similar ideas, but Spring improves on Struts. JSF has superceded Struts as the default Java EE web view technology, so it's not even considered "best" by the Java EE standard.
Stick with Spring. You won't be sorry.
I will not blame struts 2, indeed it's a great product, I work with it every day. But in my experience spring MVC is a lot simpler and clearer. This doesn't mean you don't get as much features.
Try both, and you'll see what I mean.
Tell us which one you choose!

write a mvc framework to learn struts

Hi:
I am learning struts,however I was often confused by its configuration,sometimes I do know clearly why.
SO I wonder if there is any idea to write a simple mvc framework which need not have to be prowerful enough,just make me know more about the steps the struts-like framework do.
Any ideas?
MVC is really a paradigm, and if you simply want to get up an running with an mvc framework, you can look into groovy on grails (which is built on spring mvc) and should be easy to understand and quickly configure
If you want to be adventurous, you can play with django, which is the python framework for building web apps, though they prescribe to the mvp (model view presenter) pattern.
Additionally, http://www.springsource.org/roo may be a good fit for pure Java fans
Also, there is the Struts 2 tutorials which help.
http://struts.apache.org/2.x/docs/getting-started.html
I enjoy the "Bootstrap tutorials" which is a link at the bottom of the aforementioned page.

Learning Spring MVC For web-projects

I have looked at Spring MVC a few times briefly, and got the basic ideas. However whenever I look closely it seems to require you already know a whole load of 'core Spring'. The book I have for instance has a few hundred pages before it gets onto Spring MVC... which seems a lot to wade through. I'm used to being able to jump in, but there's so much bean-related stuff and XML, it just looks like a mass of data to consume.
Does it simplify if you put the time in, or is Spring just a much bigger framework than I thought? is it possible to learn this side of it in isolation?
#John Spring just a much bigger framework than I thought? - probably so, at least I thought so.
is it possible to learn this side of it in isolation? - Yes , here is a good way to learn your way http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/spring-web.html
And also I'd recommend you read a book manning spring in action 2nd edition, I also was learning spring from zero, and now I'm comfortable with it after reading this book, of course you have to refer to reference every now and then.
Here is where you can get basic info about MVC concept if you are not already familiar with(its in php, but important thing is point not syntax)
http://net.tutsplus.com/tutorials/other/mvc-for-noobs/
EDIT
If you want to see MVC in action, with examples or other spring uses use this repository https://src.springframework.org/svn/spring-samples to checkout some projects , you'll see mvc-basic, mvc-ajax ..etc this is really good resource , you can checkout projects with Tortoise SVN on windows or subeclipse from eclipse
At least you need to understand the core Spring - dependency injection, application context configuration and so on. It's actually not too complex, just a bit hard to start. For an experienced developer it might make sense to take a look at some sample app for the basic setup.
ps. I've got this sample project for JSF/Spring/JPA/Hibernate combination. Not Spring-MVC, but may be still helpful.
I myself am trying to learn Spring MVC from NetBeans official documentation from here:
http://netbeans.org/kb/docs/web/quickstart-webapps-spring.html
Coming from ASP.Net/C#, it feels like there are so many steps to do in that simple example.
The great thing about Spring is that you can pick and choose what you use. If you want to use Spring, you don't have to jump in head first, you can just try it out by, say, using the Dependency Injection features, or by using the JDBC Template stuff. My recommendation would be to start small, and see how you like it.
To use the Web MVC stuff, you will need to understand Dependency Injection for configuring your controllers. You can choose to use the older more flexible XML-style configuration, or you can use the newer Annotations. Or you can mix and match. Starting with XML would probably be best as it will help you understand how stuff is working (it'd be like learning C and C++ before Java). Then you can move to using Annotations. Personally, I use XML to instantiate all my beans. I use the #Autowire annotation to inject dependencies. This seems to be the sweet spot for most flexibility and ease of use.

Spring MVC View

What are you guys using for your view in Spring MVC.
I know Spring MVC has a wide support for views but I'm having trouble finding what works well, what view to use when, etc.
Any insight would be great!
JSP, of course.
Sometimes PDF; Excel when necessary.
BlazeDS makes Flex integration with Spring possible. That's a great way to go if you use Flex.
"...I'm having trouble finding what works well..." - they all work well from Spring's point of view.
What to use when? Use the technology that you know best. Spring can deal with all of them just fine.
UPDATE: Since this was written three years ago, I'll amend it by saying that I would recommend just using Velocity templates to marry with dynamic data. Templates should use HTML, CSS, JavaScript, and jQuery. I think that provides the best flexibility you can have. You "future proof" your design if you can generate responsive HTML 5 pages.
We are using the following templating languages
Apache Velocity: Most of our old projects are using apache velocity to render the view. This is a very easy to learn and use language. But here xml operations are very limited.
Freemarker: Now we are migrating our project to Freemarker. This is a very good templating language. Advantage over velocity is that it has a very good support for xml data processing
You can use jsp with struts tiles to give good and uniform experience. You can refer to "Spring in Action" Book to find out how to do it. I have used this combination for developing my website www.propertymela.net. Have a look.
I am using Thymeleaf, because it has static prototyping which is very useful when there are two teams doing web design and server side development. I believe JSP is a fairly old technology, and I've had some problems with using HTML5 with it, which is why I opted to use a different view technology.
Also, Velocity is a competitor of Thymeleaf but I haven't really touched on Velocity aside from creating email templates.
JSTL is my option. JSTL has all the functional component which we can achieve through the use of scriplets in JSP. The avoidance of the scriptlet code in JSP is key to move into JSTL
In scriplet code if anything wrong whole page breaks. But it is not in the case of JSTL

Resources