You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Saeed Iqbal <sa...@gmail.com> on 2009/12/18 11:57:38 UTC

Feasibility of Programming in GWT

I know we are talking about another framework but I can get honest replies
here compared to the GWT user group.

I have been reading about GWT being a single page programming where
refreshes are not appropriate and reading more like here
http://www.onthoo.com/blog/programming/2008/02/why-i-dumped-gwt.html

Is GWT good to also program in? I know Struts 2 is the king

-- 
Saeed Iqbal
Independant Consultant
J2EE - Application Architect / Developer

JBoss 5.1.0 GA, Struts 2.0 and EJB 3.0 : SecurityClientFactory

Posted by Fernandes Celinio <cf...@sopragroup.com>.
Hi,

I have developped a stateful session bean where access to methods are
restricted :

 

@SecurityDomain("myDomainBlabla")
@RolesAllowed({"xxx", "yyy"})
@Stateful
public class BlablaBean  implements BlablaRemote {


          @RolesAllowed({"xxx"})
            public void doSomething(User user) {
            ...
            }
            ...
}

 

Authentication and authorization worls well from a JUnit test case.
Inside my JUnit class, I perform a connection :

 

          SecurityClient securityClient =
SecurityClientFactory.getSecurityClient();           
            securityClient.setSimple("user1", "pwd1");           
            securityClient.login();

No problem. The user with role xxx gets access to the method
doSomething(User user)
according to the files myApp-users.properties and myApp-roles.properties

 

I am now trying to authenticate the user in a Struts 2 action
(LoginAction) and propagate the role, using the same code :


            SecurityClient securityClient =
SecurityClientFactory.getSecurityClient();           
            securityClient.setSimple("user1", "pwd1");           
            securityClient.login();            
           
It does not work, i get an error when i try to access the method
doSomething(User user) :

 

11:22:44,456 ERROR [STDERR] javax.ejb.EJBAccessException: Invalid User

 

What is wrong ? I am guessing i need to propagate the role to the entire
app, how do i do that ?

 

Thanks for helping

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Feasibility of Programming in GWT

Posted by Alex Siman <al...@gmail.com>.
I have programmed in GWT in past. 

The advantage over Struts 2 is GWT's component model. It allows to reuse
code and leverage your favorite safe refactoring tools (say Eclipse). JSP
sucks on refactoring.

The main GWT disadvantage is Java-to-JavaScript compilation. It has no
incremental compilation. As project gets bigger - the compilation gets more
time. After compilation you have no access to GWT's JavaScript. If you want
to make little changes for running application and to see immediate changes
- then you need to recompile a GWT module.

Sometimes, just to compose some simple widget with couple of divs, I have
finished up running GWT app in Firefox with Firebug plugin. With GWT I often
reinvented the wheels. Let's take validation. Such as GWT is mostly client
side thing (JS) you cannot relay on JS validation. Definitely you should
perform validation on server. Then you need to populate all validation
messages to corresponding widgets (inputs). GWT does not have buit in
valadation. And you cannot simply add validation messages to widgets. So you
probably need to wrap standard widgets. And so on...

But there are many GWT libraries. And maybe all my problems can be covered.
And with a new version of GWT 2.0, it got many improvements like:
- development mode;
- code splitting;
- declarative UI with UiBinder.

You can read about new stuff here: 
http://googlewebtoolkit.blogspot.com/2009/12/introducing-google-web-toolkit-20-now.html

So I do not know... There is no silver bullet. And for now I am using Struts
2.

P.S. If you have thought about a new web framework, then you definitely
should checkout Lift (in Scala). 
http://liftweb.net/ It also has demo page: http://demo.liftweb.net/ 
Lift features:
- you can use all your Java code (Spring, JPA, ...);
- Scala's syntax sugar e.g. multiple inheritance - helpful thing in big
apps;;
- built-in XML support (by Scala) - really cool thing, you can reuse it in
method calls;
- it is a component framework like GWT, again - refactoring, reusing...;
- you are not bind to one action per request, but you can have as many
"actions" per request as you want due to component nature of Lift;
- and much more.

Saeed Iqbal-2 wrote:
> 
> I know we are talking about another framework but I can get honest replies
> here compared to the GWT user group.
> 
> I have been reading about GWT being a single page programming where
> refreshes are not appropriate and reading more like here
> http://www.onthoo.com/blog/programming/2008/02/why-i-dumped-gwt.html
> 
> Is GWT good to also program in? I know Struts 2 is the king
> 
> -- 
> Saeed Iqbal
> Independant Consultant
> J2EE - Application Architect / Developer
> 
> 

-- 
View this message in context: http://old.nabble.com/Feasibility-of-Programming-in-GWT-tp26841927p26851923.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org