Re: How do configure struts convention plugin with struts-spring plugin with Action class mapped with annotations

2015-03-03 Thread bavon mike
The actual problem was that struts 2.3.20 has some logging issues with
wildfly(doesnt log anything at runtime)..i just downgraded it to 2.3.16.3
and i was able to trace the error

On Mon, Mar 2, 2015 at 12:53 PM, Lukasz Lenart lukaszlen...@apache.org
wrote:

 2015-03-02 10:44 GMT+01:00 bavon mike bavom...@gmail.com:
  Even on disabling CDI and using Spring, Ajax cant locate the action
 class.
 
  Mapping the action class in struts.xml and bean in applicationContext.xml
  works fine, problems comes when i want to use annotation( convention
  plugin) for my action  class rather than using xml.

 Do you define actions in Spring context? Maybe you have excluded them
 via config-scan


 Regards
 --
 Ɓukasz
 + 48 606 323 122 http://www.lenart.org.pl/

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




Re: How do configure struts convention plugin with struts-spring plugin with Action class mapped with annotations

2015-03-02 Thread bavon mike
Even on disabling CDI and using Spring, Ajax cant locate the action class.

Mapping the action class in struts.xml and bean in applicationContext.xml
works fine, problems comes when i want to use annotation( convention
plugin) for my action  class rather than using xml.


On Mon, Mar 2, 2015 at 12:05 PM, Lukasz Lenart lukaszlen...@apache.org
wrote:

 You are mixing CDI and Spring - you should use just one DI

 2015-03-02 7:32 GMT+01:00 bavon mike bavom...@gmail.com:
  I am trying to configure spring plugin with strut 2 application, which is
  already running with convention plugin, so am using annotations. Am using
  ExtJs for my form submission which was initially working well until i
  introduced the spring plugin, now the the ajax request cannot locate the
  actions and its even not showing any response in firebug. I have tried
  searching the net, but i cant find solution of how to successfully
  configure strut2 convention plugin using annotation with struts-spring
  plugin. Currently this is what i have
 
  *pom.xml*
 
  !-- struts 2 dependencies --
  dependency
  groupIdorg.apache.struts/groupId
  artifactIdstruts2-core/artifactId
  version${struts2.version}/version
  /dependency
 
  dependency
  groupIdorg.apache.struts/groupId
  artifactIdstruts2-convention-plugin/artifactId
  version${struts2.version}/version
  /dependency
 
  dependency
  groupIdorg.apache.struts/groupId
  artifactIdstruts2-json-plugin/artifactId
  version${struts2.version}/version
  /dependency
 
  dependency
  groupIdorg.apache.struts/groupId
  artifactIdstruts2-spring-plugin/artifactId
  version${struts2.version}/version
  /dependency
 
  !-- Import the CDI API --
  dependency
  groupIdorg.apache.struts/groupId
  artifactIdstruts2-cdi-plugin/artifactId
  version${struts2.version}/version
  /dependency
  dependency
  groupIdjavax.enterprise/groupId
  artifactIdcdi-api/artifactId
  version1.0-SP1/version!--$NO-MVN-MAN-VER$--
  scopeprovided/scope
  /dependency
 
  !-- Spring framework --
  dependency
  groupIdorg.springframework/groupId
  artifactIdspring-core/artifactId
  version${spring.version}/version
  /dependency
  dependency
  groupIdorg.springframework/groupId
  artifactIdspring-context/artifactId
  version${spring.version}/version
  /dependency
  dependency
  groupIdorg.springframework/groupId
  artifactIdspring-web/artifactId
  version${spring.version}/version
  /dependency
  dependency
  groupIdorg.springframework/groupId
  artifactIdspring-beans/artifactId
  version${spring.version}/version
  /dependency
 
  *struts.xml*
 
  ?xml version=1.0 encoding=UTF-8 ?
  !DOCTYPE struts PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
  http://struts.apache.org/dtds/struts-2.0.dtd;
 
  struts
  constant name=struts.custom.i18n.resources
  value=ApplicationResources /
  constant name=struts.devMode value=true /
  constant name=struts.convention.result.path value=/content /
  constant name=struts.multipart.saveDir value=/tmp /
  constant name=struts.multipart.maxSize value=4194304 /
  constant name=struts.action.excludePattern value=/api/.*? /
 
  /struts
 
  *web.xml*
 
  display-nameApplication/display-name
  welcome-file-list
welcome-fileindex.html/welcome-file
  /welcome-file-list
 
  filter
  filter-namestruts2/filter-name
 
 
 filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter/filter-class
  /filter
 
  filter-mapping
  filter-namestruts2/filter-name
  url-pattern/*/url-pattern
  /filter-mapping
 
  listener
 
 
 listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
 
  /listener
 
  servlet
servlet-nameResteasy/servlet-name
 
 
 servlet-classorg.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher/servlet-class
  /servlet
  servlet-mapping
servlet-nameResteasy/servlet-name
url-pattern/api/*/url-pattern
  /servlet-mapping
  context-param
  param-nameresteasy.scan/param-name
  param-valuetrue/param-value
  /context-param
  context-param
param-nameresteasy.servlet.mapping.prefix/param-name
param-value/api/param-value
  /context-param
  listener
 
 
 listener-classorg.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap/listener-class
  /listener
 
  *applicationContext.xml*
 
  ?xml version=1.0 encoding=UTF-8?
  beans xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:aop=
  http://www.springframework.org/schema/aop;
 xmlns:tx=http://www.springframework.org/schema/tx;
 xsi:schemaLocation=
http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd;
  /beans
 
  *Action Class*
  @Namespace(/units)
  @Result(
  type = stream,
  params = {
  inputName, stream
  }
  )
  public class PropertyTypeAction

Re: How do configure struts convention plugin with struts-spring plugin with Action class mapped with annotations

2015-03-02 Thread bavon mike
i have tried constant name=struts.objectFactory value=spring / but no
result.

On Mon, Mar 2, 2015 at 10:29 AM, Johannes Geppert jo...@apache.org wrote:

 According to the spring plugin documentation [1] you need to setup
 following constant in your struts config.

 constant name=struts.objectFactory value=spring /


 Best Regards

 Johannes

 [1] https://cwiki.apache.org/confluence/display/WW/Spring+Plugin


 #
 web: http://www.jgeppert.com
 twitter: http://twitter.com/jogep


 2015-03-02 7:32 GMT+01:00 bavon mike bavom...@gmail.com:

  I am trying to configure spring plugin with strut 2 application, which is
  already running with convention plugin, so am using annotations. Am using
  ExtJs for my form submission which was initially working well until i
  introduced the spring plugin, now the the ajax request cannot locate the
  actions and its even not showing any response in firebug. I have tried
  searching the net, but i cant find solution of how to successfully
  configure strut2 convention plugin using annotation with struts-spring
  plugin. Currently this is what i have
 
  *pom.xml*
 
  !-- struts 2 dependencies --
  dependency
  groupIdorg.apache.struts/groupId
  artifactIdstruts2-core/artifactId
  version${struts2.version}/version
  /dependency
 
  dependency
  groupIdorg.apache.struts/groupId
  artifactIdstruts2-convention-plugin/artifactId
  version${struts2.version}/version
  /dependency
 
  dependency
  groupIdorg.apache.struts/groupId
  artifactIdstruts2-json-plugin/artifactId
  version${struts2.version}/version
  /dependency
 
  dependency
  groupIdorg.apache.struts/groupId
  artifactIdstruts2-spring-plugin/artifactId
  version${struts2.version}/version
  /dependency
 
  !-- Import the CDI API --
  dependency
  groupIdorg.apache.struts/groupId
  artifactIdstruts2-cdi-plugin/artifactId
  version${struts2.version}/version
  /dependency
  dependency
  groupIdjavax.enterprise/groupId
  artifactIdcdi-api/artifactId
  version1.0-SP1/version!--$NO-MVN-MAN-VER$--
  scopeprovided/scope
  /dependency
 
  !-- Spring framework --
  dependency
  groupIdorg.springframework/groupId
  artifactIdspring-core/artifactId
  version${spring.version}/version
  /dependency
  dependency
  groupIdorg.springframework/groupId
  artifactIdspring-context/artifactId
  version${spring.version}/version
  /dependency
  dependency
  groupIdorg.springframework/groupId
  artifactIdspring-web/artifactId
  version${spring.version}/version
  /dependency
  dependency
  groupIdorg.springframework/groupId
  artifactIdspring-beans/artifactId
  version${spring.version}/version
  /dependency
 
  *struts.xml*
 
  ?xml version=1.0 encoding=UTF-8 ?
  !DOCTYPE struts PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
  http://struts.apache.org/dtds/struts-2.0.dtd;
 
  struts
  constant name=struts.custom.i18n.resources
  value=ApplicationResources /
  constant name=struts.devMode value=true /
  constant name=struts.convention.result.path value=/content /
  constant name=struts.multipart.saveDir value=/tmp /
  constant name=struts.multipart.maxSize value=4194304 /
  constant name=struts.action.excludePattern value=/api/.*? /
 
  /struts
 
  *web.xml*
 
  display-nameApplication/display-name
  welcome-file-list
welcome-fileindex.html/welcome-file
  /welcome-file-list
 
  filter
  filter-namestruts2/filter-name
 
 
 
 filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter/filter-class
  /filter
 
  filter-mapping
  filter-namestruts2/filter-name
  url-pattern/*/url-pattern
  /filter-mapping
 
  listener
 
 
 
 listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
 
  /listener
 
  servlet
servlet-nameResteasy/servlet-name
 
 
 
 servlet-classorg.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher/servlet-class
  /servlet
  servlet-mapping
servlet-nameResteasy/servlet-name
url-pattern/api/*/url-pattern
  /servlet-mapping
  context-param
  param-nameresteasy.scan/param-name
  param-valuetrue/param-value
  /context-param
  context-param
param-nameresteasy.servlet.mapping.prefix/param-name
param-value/api/param-value
  /context-param
  listener
 
 
 
 listener-classorg.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap/listener-class
  /listener
 
  *applicationContext.xml*
 
  ?xml version=1.0 encoding=UTF-8?
  beans xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:aop=
  http://www.springframework.org/schema/aop;
 xmlns:tx=http://www.springframework.org/schema/tx;
 xsi:schemaLocation=
http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd;
  /beans
 
  *Action Class*
  @Namespace

How do configure struts convention plugin with struts-spring plugin with Action class mapped with annotations

2015-03-01 Thread bavon mike
I am trying to configure spring plugin with strut 2 application, which is
already running with convention plugin, so am using annotations. Am using
ExtJs for my form submission which was initially working well until i
introduced the spring plugin, now the the ajax request cannot locate the
actions and its even not showing any response in firebug. I have tried
searching the net, but i cant find solution of how to successfully
configure strut2 convention plugin using annotation with struts-spring
plugin. Currently this is what i have

*pom.xml*

!-- struts 2 dependencies --
dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-core/artifactId
version${struts2.version}/version
/dependency

dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-convention-plugin/artifactId
version${struts2.version}/version
/dependency

dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-json-plugin/artifactId
version${struts2.version}/version
/dependency

dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-spring-plugin/artifactId
version${struts2.version}/version
/dependency

!-- Import the CDI API --
dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-cdi-plugin/artifactId
version${struts2.version}/version
/dependency
dependency
groupIdjavax.enterprise/groupId
artifactIdcdi-api/artifactId
version1.0-SP1/version!--$NO-MVN-MAN-VER$--
scopeprovided/scope
/dependency

!-- Spring framework --
dependency
groupIdorg.springframework/groupId
artifactIdspring-core/artifactId
version${spring.version}/version
/dependency
dependency
groupIdorg.springframework/groupId
artifactIdspring-context/artifactId
version${spring.version}/version
/dependency
dependency
groupIdorg.springframework/groupId
artifactIdspring-web/artifactId
version${spring.version}/version
/dependency
dependency
groupIdorg.springframework/groupId
artifactIdspring-beans/artifactId
version${spring.version}/version
/dependency

*struts.xml*

?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.0//EN
http://struts.apache.org/dtds/struts-2.0.dtd;

struts
constant name=struts.custom.i18n.resources
value=ApplicationResources /
constant name=struts.devMode value=true /
constant name=struts.convention.result.path value=/content /
constant name=struts.multipart.saveDir value=/tmp /
constant name=struts.multipart.maxSize value=4194304 /
constant name=struts.action.excludePattern value=/api/.*? /

/struts

*web.xml*

display-nameApplication/display-name
welcome-file-list
  welcome-fileindex.html/welcome-file
/welcome-file-list

filter
filter-namestruts2/filter-name

filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter/filter-class
/filter

filter-mapping
filter-namestruts2/filter-name
url-pattern/*/url-pattern
/filter-mapping

listener

listener-classorg.springframework.web.context.ContextLoaderListener/listener-class

/listener

servlet
  servlet-nameResteasy/servlet-name

servlet-classorg.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher/servlet-class
/servlet
servlet-mapping
  servlet-nameResteasy/servlet-name
  url-pattern/api/*/url-pattern
/servlet-mapping
context-param
param-nameresteasy.scan/param-name
param-valuetrue/param-value
/context-param
context-param
  param-nameresteasy.servlet.mapping.prefix/param-name
  param-value/api/param-value
/context-param
listener

listener-classorg.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap/listener-class
/listener

*applicationContext.xml*

?xml version=1.0 encoding=UTF-8?
beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:aop=
http://www.springframework.org/schema/aop;
   xmlns:tx=http://www.springframework.org/schema/tx;
   xsi:schemaLocation=
  http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd;
/beans

*Action Class*
@Namespace(/units)
@Result(
type = stream,
params = {
inputName, stream
}
)
public class PropertyTypeAction extends BaseAction implements ActionImpl{

@PersistenceUnit
private EntityManagerFactory emf;

@Action(value=add)
public String add() {
...

}
}

*Ajax Request firebug report, XML tab*
XML Parsing Error: no element found Location:
moz-nullprincipal:{7fc640bd-f293-4956-8cf2-178765cec735} Line Number 1,
Column 1:

My request is how can i configure struts-spring plugin to work with struts
convention plugin with the annotations.


How do i prevent Struts 2 json plugin from escaping already formated json?

2015-02-18 Thread bavon mike
I already have a json string like:

{name: Simple name, description: simple description}

When using Struts 2 json plugin, it returns escaped string like:

{\name\: \Simple name\, \description\: \simple description\}

How do i configure struts 2 plugin to avoid this escaping?

Regards
Mike