I want to build a wizard screens for my project. For that i am using struts2 framework. Can anyone help me....
You will want to implement the ScopeInterceptor to create wizard like interfaces. An alternative is to implement custom conversational scope. A great tutorial on this can be found here.
My suggestion is... don't. At least not directly. Use Spring Webflow. It is vastly superior at wizard and conversational state style processes. Note: Spring Webflow can be used on top of other Web frameworks, most notably Spring MVC and JSF. There is a Struts 2 Webflow plug-in.
If you're not going to use Webflow, it's not really much different to coding normal controllers/actions/views/forms, except the logic can get really tedious.
Related
I've been searching all day for an answer to my problem, and don't seem to be able to find an answer.
I'm trying to implement a CRUD web application using Grails, with the IntelliIDEA IDE. Whereas with JSF i could use primefaces which allowed me to do this with general ease, i am disappointed to see, or at least seems to be that way, that the framework is a step backwards when it comes to development of html pages.
All i want is to have a table that is populated from data that is coming from a controller, and whenever i add a record it is also displayed in this table. I want to be able to edit any record on this table and also remove records. It would be awesome if there could be a component like primefaces datatables that allows me to do this easily, without having to use JavaScript. I've taken a look to the Dojo plugin, but it's so outdated and incomprehensible to me that i have discarded this option, mainly because there is no documentation on the site on how to use it with Grails, specifically.
Also, i do not want to use scaffolding. I am trying to learn how to do this from scratch, and it is of my understanding that it doesn't work too well with domains with many to many relationship, for example.
In a nutshell, what I am looking for is the best way to make a CRUD application on Grails that doesn't involve the use of scaffolding.
I would suggest you to go through "Grails in Action" book and follow the creation of web application "Quote of the Day" and "Hubbub", don't use scaffolding instead create your own views and controller using documentation provided.
This will help you to understand basic CRUD operations in Grails.
And also looking into documentation http://grails.github.io/grails-doc/latest/guide/theWebLayer.html
See if this can help you.
You are aware that the scaffolding also can generate code for you to learn from and continue your work from there (i.e. it doesn't have to happen magically behind the curtains). I would say that is the typical means of starting out with Grails and CRUD.
Otherwise, no Dojo probably won't help you out a lot. Maybe have a look at some other plugin, for instance the Easygrid plugin? It is based on Javascript though, which most solutions do.
The "Grails in Action" recommendation is probably your best bet for the long-term, learning it from the pro's rather than learning-by-doing/top-to-bottom CRUD-style.
I am coming from the Spring + Hibernate + JSF/primefaces site. What I like in Grails is its scaffolding site, so that basic CRUD apps can be created rather quickly.
However, which libaries do you recommend for a beginner in Grails for creating a UI? It should be created quickly and straightforward and also be feature rich (have a look at the primefaces libary)!
The very basic GSP pages are really powerful, especially when combined with any modern JS library. With them you can assemble a complex rich GUIs in instant (well, almost :) )
There are also numerous grails plugins to include almost any view technology of your choice into your web-app, e.g. http://grails.org/plugin/kickstart-with-bootstrap
I would suggest http://grails.org/plugin/twitter-bootstrap once installed you can use the documentation at http://getbootstrap.com/ as your guide.
I am going to develope a web application. Which framework(struts1 or struts2) should i choose?
Which one is easier to understand and code.
Is applying CSS/HTML in struts2 difficult?
I have used Struts1 and Struts 2 extensively. Struts2 is far better than Struts 1. Struts 2 is the way forward. There are a whole lots of improvements in Struts 2.
The use of interceptors.
Pojo like actions
No action forms.
Easy integration with other frameworks like spring, dwt etc
[I deleted the part about this being a too generic question, as I misread the initial question, sorry...]
Use struts2 since they obviously learned from what was flawed in Struts1. They introduced interfaces so that you can extend your own classes and use Dynaforms for form data binding (in struts 1 you have to write such a FormBean for every f*** form in your app). If you use struts you should also use tiles.
Another framework that is definitely worth a look is Wicket. So far so good. Good luck!
I think struts2 is better .Please read the below article
http://www.java-samples.com/showtutorial.php?tutorialid=200
Use struts 2 and you can also integrate it with spring.
I'm starting a fairly complex grails app but am a bit slow hand-coding nice user interface pages directly in CSS/HTML. Several people have recommended IntelliJ for the grails app development, and I plan to use mostly grails scaffolding for the admin portion of the site.
Can you recommend an approach or tools for building a nice UI fairly fast?
Thanks
P.S. Eventually I plan to build "skinnier" mobile version as well.
One approach might be to continue to use the grails sitemesh main.gsp and just concentrate on your functionality using the scaffold-ed pages as examples. Once you are ready to tackle the style aspect you can deviate from the grails main.gsp template and create your own tailored for your look and feel.
If your complexity includes a fairly custom UI, I don't think your going to get a free lunch. You'll have to break down and code the UI.
I'm currently using jQuery UI coupled with jqGrid to get some fairly sophisticated grid / tree behavior in my UI with not too much html coding. I'm also using the jQuery UI Layout Plugin to manage pane layout and make my app look/feel more like an app rather than a page. Grails plays real nice with the ajax needs of jqGrid.
If I know Rails, what new ideas/patterns would I learn if I looked at Grails?
I have no intention to move to Grails and no need for a Java stack, but if there are neat ideas I could learn from Grails I'd like to learn them.
Grails has taken totally different direction. It is very hard to compare Grails and Rails.
Grails is not framework. It is stack of frameworks. You can find all the features you find in plain Spring, Hibernate, Quartz, Compass, Sitemesh frameworks. So at the end you get all the best from all these frameworks with convention-over-configuration.
However, I really want to mention about very interesting idea introduced in Grails about modulizing the application into plugins. Plugin in Grails is minimized independent project. Separating application logics into plugins allows to share your code to community and keep application in separate modules which results in easier testing and easier development.
Grails has at least two patterns I'm aware of that I believe do not exist in Rails:
Command objects (and auto binding request params to them)
Conversation based request handling using web flows