Re: JSON Plugin and S:Action

2009-07-15 Thread Chris Pratt
Ok, calling it from AJAX, instead of s:action, seems to work, but unfortunately it appears the JSON Plugin isn't compatible with Struts 2.1. I'm currently using 2.1.2, but the documentation says that it works with 2.0.6. Is there any plan to update it to work with 2.1? What I'm seeing is:

Re: JSON Plugin and S:Action

2009-07-15 Thread Chris Pratt
Ok, now I'm totally confused. The documentation at http://cwiki.apache.org/S2PLUGINS/json-plugin.html says that the plug-in required 2.0.6 or greater. It clearly did not support 2.1.2, but it seems to support 2.1.6. Is the documentation wrong, should that say 2.1.6 instead of 2.0.6? (*Chris*)

Re: how to configure struts2 for /*.action?

2009-07-15 Thread Dave Newton
ravi_eze wrote: did u mean that we cant map only *.action to struts filter? Or u were telling of some workaround? Why does struts put this restriction that all urls should pass through him? As has been stated, S2 serves its own static content. If you're serving the static content yourself

Re: how to configure struts2 for /*.action?

2009-07-15 Thread 谢冬鸣
Hi ravi_eze, One of our projects use Struts2, we have two url patterns /*.action and /webservice/*, the first one is served by Struts2 and the second is served by CXF framework directly. is this what you want? On Wed, Jul 15, 2009 at 11:06, ravi_eze ravichand...@ivycomptech.comwrote: i didnt

Re: how to configure struts2 for /*.action?

2009-07-15 Thread ravi_eze
hi, Thanks for the response. We are not serving static content. We have a JSP which is used to upload images/ files etc.(submits the form to /upload.jsp) When we give the struts mapping, this Jsp doesnt work. As said in:

Re: JSON Plugin and S:Action

2009-07-15 Thread Wes Wannemacher
On Wed, Jul 15, 2009 at 3:35 AM, Chris Prattthechrispr...@gmail.com wrote: Ok, now I'm totally confused.  The documentation at http://cwiki.apache.org/S2PLUGINS/json-plugin.html says that the plug-in required 2.0.6 or greater.  It clearly did not support 2.1.2, but it seems to support 2.1.6.  

Struts2 Action Class and EJB Injection

2009-07-15 Thread Robin Mannering
Hello, Platform : Struts 2, EJB 3.0, Glassfish 2.1 I wish to obtain a reference to an EJB using injection. This works fine within a servlet, but from within a Struts2 action class, all references to injected EJB variables hold a 'null' reference. I've included a portion of my action class

Re: Struts2 Action Class and EJB Injection

2009-07-15 Thread Wes Wannemacher
The difference is that the container did not instantiate your struts action, struts did. There are EJB plugins available, check the plugin registry. http://cwiki.apache.org/S2PLUGINS/home.html The ones I have seen are based on injection via interceptor. I've toyed with the notion of creating an

ParameterInterceptor problem

2009-07-15 Thread Say Jon
Hi all, I have been using Struts 2 for a while now and I am pulling my hair over the following issue. At times, when my parameter name contains a period, the Parameterinterceptor doesn't seem to be applied properly. For example I have a parameter userAddress.country.id which points to

Re: Struts2 Action Class and EJB Injection

2009-07-15 Thread Robin Mannering
Many thanks for the prompt and detailed reply. I understand why the use of injection does not work now within a Struts2 action class. However, there only seems one EJB plugin available, which doesn't actually have a download available and hasn't had for some time it appears.

Re: Struts2 Action Class and EJB Injection

2009-07-15 Thread Wes Wannemacher
You are right, there is only one, the other one in that list is a jboss-ejb plugin. Take a look at the source for the plugin, it is not particularly complex and I know the author is lurking around here somewhere. I would suggest that you do one of two things - 1. Create an interceptor, probably

Re: ParameterInterceptor problem

2009-07-15 Thread Robert Graf-Waczenski
Even though you are pretty vague in what you write below, i have a few pointers for you: 1) Check (and tell us) if you designed your action implements the ModelDriven interface (guessed from you talking about getModel() below) 2) Maybe your getModel() returns an improperly initialized instance

Re: Struts2 Action Class and EJB Injection

2009-07-15 Thread Robin Mannering
Hi Wes, I found a resource on the web that seems to be a simpler solution: InitialContext ic = new InitialContext(); UserServiceBeanLocal userService = (UserServiceBeanLocal) ic.lookup(UserServiceBeanLocal.class.getName()); As in the web resource I found, it was necessary to change @Local to

Re: Struts2 Action Class and EJB Injection

2009-07-15 Thread Wes Wannemacher
I don't see anything wrong with that. I'd still like to eventually create a plugin that removes the need to do that in your execute method. The EJB spec added those annotations, so I'd like to figure out a way to honor them (cleanly). -Wes On Wed, Jul 15, 2009 at 10:37 AM, Robin

Re: Struts2 Action Class and EJB Injection

2009-07-15 Thread Robin Mannering
Yes, using annotations would be the ideal method. I think I remember reading that declaring beans as 'remote' when this is not that case, may cause unnecessary serialization/deserialization as calls are supposedly being made remotely. Depending on the EJB app server configuration.

Re: JSON Plugin and S:Action

2009-07-15 Thread Musachy Barroso
I think the last release worked with 2.1 right? musachy On Wed, Jul 15, 2009 at 5:59 AM, Wes Wannemacherw...@wantii.com wrote: On Wed, Jul 15, 2009 at 3:35 AM, Chris Prattthechrispr...@gmail.com wrote: Ok, now I'm totally confused.  The documentation at

Re: Struts2 Action Class and EJB Injection

2009-07-15 Thread Nathan Schulte
Robin Mannering wrote: Is there anybody that is using Struts2 as the 'frontend' to an EJB 3 'backend' and what solution do you currently employ. I am using the described setup, yes. Our solution was to use the mentioned EJB3 plugin and it's @InjectEJB annotation. It works well, I have not

Possible upgrade to xwork 2.1.4

2009-07-15 Thread David Canos
hi folks Currently Struts 2.1.6 is working with xwork 2.1.2 which has some bugs related to i18n. They are fixed in xwork 2.1.3. http://jira.opensymphony.com/browse/XW-679 I've check struts jira and i haven't seen any upgrade xwork issue. It's hard to work in a i18n context while the

Re: Struts2 Action Class and EJB Injection

2009-07-15 Thread Robin Mannering
Can you please tell me how you obtained the EJB plugin and a short example of using it. I would prefer to use this if possible. Nathan Schulte wrote: Robin Mannering wrote: Is there anybody that is using Struts2 as the 'frontend' to an EJB 3 'backend' and what solution do you currently

Re: JSON Plugin and S:Action

2009-07-15 Thread Chris Pratt
Yup, the latest jar file works with 2.1.6 (but not 2.1.2 for the record). (*Chris*) On Wed, Jul 15, 2009 at 8:11 AM, Musachy Barroso musa...@gmail.com wrote: I think the last release worked with 2.1 right? musachy On Wed, Jul 15, 2009 at 5:59 AM, Wes Wannemacherw...@wantii.com wrote: On

Re: JSON Plugin and S:Action

2009-07-15 Thread Wes Wannemacher
On Wed, Jul 15, 2009 at 11:56 AM, Chris Prattthechrispr...@gmail.com wrote: Yup, the latest jar file works with 2.1.6 (but not 2.1.2 for the record).  (*Chris*) What went wrong in 2.1.2? This intrigues me :) -Wes On Wed, Jul 15, 2009 at 8:11 AM, Musachy Barroso musa...@gmail.com wrote: I

Re: Possible upgrade to xwork 2.1.4

2009-07-15 Thread Wes Wannemacher
If you are not using REST or the rest plugin, you can use struts 2.1.7, it is not a GA release because there was a missing class in the rest plugin. Or, you can build 2.1.8-SNAPSHOT. We should be getting an xwork 2.1.5 release soon and we'll roll a struts 2.1.8 release right afterwards. If the

Re: JSON Plugin and S:Action

2009-07-15 Thread Chris Pratt
It was in one of my earlier posts, but I was getting this: java.lang.NoSuchMethodError: com.opensymphony.xwork2.ActionContext.get(Ljava/lang/String;)Ljava/lang/Object; at com.googlecode.jsonplugin.JSONResult.execute(JSONResult.java:157) at

Re: JSON Plugin and S:Action

2009-07-15 Thread Wes Wannemacher
That's weird, now you have me more curious, I don't remember making changes to get it working in 2.1, other than updating unit tests... Musachy, do you remember that going from 2.1.2 to 2.1.3? I was using it with 2.1.3-SNAPSHOT quite a bit, so it must have been something that changed shortly after

RE: JSON Plugin and S:Action

2009-07-15 Thread Martin Gainty
version ? Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte

Re: JSON Plugin and S:Action

2009-07-15 Thread Musachy Barroso
yeah, something did change and I think ti was some signature from MapString, String to MapString, Object or the other way around. On Wed, Jul 15, 2009 at 9:08 AM, Wes Wannemacherw...@wantii.com wrote: That's weird, now you have me more curious, I don't remember making changes to get it working

Struts2 + JPA - Lazy Initialization During View Generation

2009-07-15 Thread Nathan Schulte
I'm currently using Struts2 in a project that is utilizing the Java Persistence API (JPA, specifically Hibernate) with container managed transactions (CMT). To access the Persistence layer, a layer was created using SLSBs as service objects which provide simple entity_type getentity_typeById( int

Re: Struts2 Action Class and EJB Injection

2009-07-15 Thread Nathan Schulte
Robin Mannering robin at mtndesigns.co.uk writes: Can you please tell me how you obtained the EJB plugin and a short example of using it. I would prefer to use this if possible. Sorr, I misspoke earlier. I'm actually using the EJB3 JBoss Plugin, from here

Initializing Application

2009-07-15 Thread Balwinder Kumar
Hi All, I am trying to develop a framework based on Struts 2, I am finding it very difficult to decide where to put the code that is generally called in ActionServlet init method. Any pointer towards this. Thanks in advance. Regards, Balwinder Kumar

Re: Possible upgrade to xwork 2.1.4

2009-07-15 Thread David Canos
I resolved writing my own i18n-interceptor. Firstly I try to get the locale from session, if not I look for in the request, if not we use the ActionContext by default set up in struts.properties. Anyway this is not the xwork 2.1.4 behavior, who looks for locale in session, and then ActionContext.

Re: Struts2 + JPA - Lazy Initialization During View Generation

2009-07-15 Thread David Canos
I use a Hibernate.initilize() call in the DAO layer for every object I need to see in the presentation layer (common jsp files).it avoids Lazy Initializations without passing Hibernate Proxy around layers. It works fine for me 2009/7/15 Nathan Schulte nathan.schu...@ngc.com I'm currently using

Re: Initializing Application

2009-07-15 Thread David Canos
I think Struts 2 uses a Struts2Filter to do the init issues of the each request 2009/7/15 Balwinder Kumar balwinder@gmail.com Hi All, I am trying to develop a framework based on Struts 2, I am finding it very difficult to decide where to put the code that is generally called in

Re: Struts2 + JPA - Lazy Initialization During View Generation

2009-07-15 Thread Nathan Schulte
David Canos davidcanos at gmail.com writes: I use a Hibernate.initilize() call in the DAO layer for every object I need to see in the presentation layer (common jsp files).it avoids Lazy Initializations without passing Hibernate Proxy around layers. This was one of my last resort ideas. It

Re: JSON Plugin and S:Action

2009-07-15 Thread Chris Pratt
Yup, I had to change a couple of my helper classes because of that change. (*Chris*) On Wed, Jul 15, 2009 at 9:14 AM, Musachy Barroso musa...@gmail.com wrote: yeah, something did change and I think ti was some signature from MapString, String to MapString, Object or the other way around.

[S2] json plugin + junit plugin

2009-07-15 Thread Relph,Brian
Is there a reason the json plugin has a compile-time dependency on the junit plugin? Is it just a test dependency perhaps? I would like to exclude the junit plugin from my webapp, but I don't want to break anything down the line. Brian Relph

[S2] xwork + spring-test

2009-07-15 Thread Relph,Brian
Is there a reason xwork has a compile-time dependency on spring-test? Is it just a test dependency perhaps? I would like to exclude spring-test from my webapp, but I don't want to break anything. Brian Relph --

Re: [S2] json plugin + junit plugin

2009-07-15 Thread Musachy Barroso
The scope is test, so the dependency won't propagate to your web app. but yeah, it shouldn't be there, it is probably a copy/paste error. musachy On Wed, Jul 15, 2009 at 11:49 AM, Relph,Brianbrian.re...@cerner.com wrote: Is there a reason the json plugin has a compile-time dependency on the

Re: [S2] xwork + spring-test

2009-07-15 Thread Musachy Barroso
see my answer to the other email, it applies here also, except that in this case the dependency is needed for the tests. musachy On Wed, Jul 15, 2009 at 12:04 PM, Relph,Brianbrian.re...@cerner.com wrote: Is there a reason xwork has a compile-time dependency on spring-test?  Is it just a test

Re: Initializing Application

2009-07-15 Thread Paweł Wielgus
Hi, i'm initing my apps by implementing ServletContextListener and registering it in web.xml like that: web-app listener listener-classcom.my.ServletContextListenerImplementation/listener-class /listener /web-app It has nothing to do with struts but i hope that's

Need to update one single field via Ajax

2009-07-15 Thread Bruno
Hey guys, I'm using Struts 2.1.6 with Spring... I've always used sx:div for auto refresh, whenever is necessary, but I now I need to keep updated one single field and I'm not allowed to use sx:div with updateFreq So I'll have to make it all manually using JavaScript. The problem is that I simply

Re: how to configure struts2 for /*.action?

2009-07-15 Thread Dave Newton
ravi_eze wrote: We are not serving static content. Not *you*, *Struts 2*. What will happen if i do *.action? Why did the doc say /* *should* be in web.xml? Because of what you've already been told a couple of times now. Dave

RE: how to configure struts2 for /*.action?

2009-07-15 Thread Martin Gainty
look at a working example.. showcase contain these *.action entries in /WEB-INF/web.xml servlet servlet-namefaces/servlet-name servlet-classjavax.faces.webapp.FacesServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet

RE: how to configure struts2 for /*.action?

2009-07-15 Thread Struts Two
Just keep in mind by setting /*.action for your struts filter url, you may cause yourself some problems down the road depending on the app server you use, as struts 2 is not following servlet 2.4 spec in this regard. filters are not supposed to be accessed directly as a resource according to

Re: Initializing Application

2009-07-15 Thread Balwinder Kumar
Thanks Pawel and David for your response. I would like to evaluate both option before proceeding. Regards, Balwinder Kumar Paweł Wielgus wrote: Hi, i'm initing my apps by implementing ServletContextListener and registering it in web.xml like that: web-app listener

Re: Struts2 Action Class and EJB Injection

2009-07-15 Thread Robin Mannering
Thanks for the example. I shall download the source and give it a go. Thanks again. Nathan Schulte wrote: Robin Mannering robin at mtndesigns.co.uk writes: Can you please tell me how you obtained the EJB plugin and a short example of using it. I would prefer to use this if possible.

org.apache.jasper.JasperException: The Struts dispatcher cannot be found.

2009-07-15 Thread jayadevan
hi all i am using struts2 for my pjt when i try to excute pjt the following exception occured pls help me thanks in advance org.apache.jasper.JasperException: The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are