how to use Roles Interceptor in struts 2 - struts2

I'm want to make use of the RolesInterceptor which comes with Struts 2 in my application for authorization of users. But doesn't found any reference to implement it.
Would appreciate your kind hints.

Related

How to implement CSFR security enhancement with existing Grails project

How do I implement the CSFR security enhancement in my existing Grails project? I have read that I have to use token in form and modify the query string. I do not think it is best solution because in my project there are a lot of submit forms and many controllers.
The fact is you are going to have to change the way you submit forms and add in the token to each of the forms and change your controllers to check the token. If you want CSFR protection you'll have to touch all of those places.
Fortunately Grails offers useToken and withForm to help take care of the implementation for you. You just have to put it in where you want it.
You can read more about this in the documentation.

ZfcRbac or BjyAuthorize or both to be used?

I am working on a Zendframework 2 project. I need to implement access control in to my application. This is my first time with zf. When I investigated about ACL i came across 2 modules ZfcRbac and BjyAuthorize. I am confused.
My Question is Should I use these both or either?
ADDITIONAL : If either, If any body know any blog post or article comparing the pros and cons of both, please suggest me.
Maybe this will help you with your decision:
Instant ACLs with Zend Framework 2

Which Framework to choose

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.

implementing HDIV framework in grails application

I am looking at the HDIV framework to implement it in my Grails application. Looks like the framework is more user friendly to Struts/java based applications. They do say it can be configured on other frameworks. This is what it exactly says:
It is possible to use HDIV in applications that don’t use Struts 1.x, Struts 2.x, Spring MVC or JSTL, but in this case it is necessary to modify the application (JSP pages).
I see that we need to modify the editable and non editable data being sent to the server (one of the strategies is to cypher code the hidden field and add a state parameter to link urls.)
And in the response we get back this data and use a validate() function to do integrity checks.
The sample grails-HDIV project on GITHUB is really basic with no details.
Has anyone implemented it on grails?
Thanks
Priyank
I've just written a plugin for this very thing. I'll see if my company will let me release it and if so I'll inform you.

How to create wizard screen layout using struts2?

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.

Resources