Author Login
Post Reply
user Digest 1 Sep 2010 06:45:22 -0000 Issue 9160
Topics (messages 207330 through 207346):
Re: Running Struts1 and Struts2 together?
207330 by: J_e_f_f
207331 by: Dave Newton
EL not working in tomcat 5.5.28 works in myeclipse
207332 by: abhishek jain
207333 by: abhishek jain
207334 by: abhishek jain
207346 by: abhishek jain
Struts2 REST plugin problems
207335 by: Rafael Taboada
207336 by: Rafael Taboada
207337 by: Dale Newfield
207338 by: Dale Newfield
207339 by: Rafael Taboada
207340 by: Dale Newfield
207341 by: Rafael Taboada
207342 by: Dale Newfield
207343 by: Rafael Taboada
207344 by: Rafael Taboada
207345 by: Dale Newfield
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_207330.ezm (zipped)
Stephen Turner wrote:
>
> but I've no idea how big a job it is, what the pitfalls
> are etc.
>
>
It's not difficult to add struts 2 to an existing struts 1 app. We have two
apps that have both struts1 and struts 2 actions. You just define your
struts 2 filter in your application's web.xml like Andrew's example, and
follow the struts 2 documentation for setting up the rest.
When we made the decision to create any new actions in Struts 2 it seemed
like a good idea but has proven painful at times. If I had the decision to
make again in the same situation, we would have done something
different--staying with Struts1, converting everything to Struts 2, or even
trying the Struts 1 plugin.
The biggest problem is when you have a struts 1 action configured with a
struts 2 forward. Reasonably so, you have to set the redirect flag to true.
Most of the time this isn't a big deal but if your Struts 1 action has to
propagate error messages to a struts 2 page you have to glue it together,
which is ugly.
We've had several similar gotchas along the way related to transitioning
from one to the other as well. If you do mix the frameworks, draw a line in
the sand that an action defined in one framework can't have a result in the
other.
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_207331.ezm (zipped)How is gluing messages together ugly? Wouldn't it be a matter of an
interceptor snarfing session/request data from S1 and massaging it into S2?
What were the sticking points?
Dave
On Tue, Aug 31, 2010 at 8:09 AM, J_e_f_f <jam0916@(protected):
>
>
>
> Stephen Turner wrote:
> >
> > but I've no idea how big a job it is, what the pitfalls
> > are etc.
> >
> >
> It's not difficult to add struts 2 to an existing struts 1 app. We have two
> apps that have both struts1 and struts 2 actions. You just define your
> struts 2 filter in your application's web.xml like Andrew's example, and
> follow the struts 2 documentation for setting up the rest.
>
> When we made the decision to create any new actions in Struts 2 it seemed
> like a good idea but has proven painful at times. If I had the decision to
> make again in the same situation, we would have done something
> different--staying with Struts1, converting everything to Struts 2, or even
> trying the Struts 1 plugin.
>
> The biggest problem is when you have a struts 1 action configured with a
> struts 2 forward. Reasonably so, you have to set the redirect flag to true.
> Most of the time this isn't a big deal but if your Struts 1 action has to
> propagate error messages to a struts 2 page you have to glue it together,
> which is ugly.
>
> We've had several similar gotchas along the way related to transitioning
> from one to the other as well. If you do mix the frameworks, draw a line in
> the sand that an action defined in one framework can't have a result in the
> other.
> --
> View this message in context:
> http://old.nabble.com/Running-Struts1-and-Struts2-together--tp29514921p29582208.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_207332.ezm (zipped)Hi friends,
I have a website in struts 1.2 hosted on tomcat 5.5.x and it uses EL.
It is not being evaluated, any suggestions on the reasons why?
I used struts 1.2 , myeclipse, tomcat 5.5.28 .
EL is not working on live but works on development environment on myeclipse.
I have tried changing the web.xml to 2.4 from 2.5 etc.
Pl. help.
--
Thanks and kind Regards,
Abhishek jain

Attachment:
user_207333.ezm (zipped)Hey ,
I just realized i acidently placed el-api.jar in WEB-INF/lib folder.
If i dont than i get the following exception:
Aug 31, 2010 4:28:44 PM
org.apache.catalina.core.StandardContextlistenerStart
SEVERE: Error configuring application listener of class
com.sun.faces.config.ConfigureListenerjava.lang.NoClassDefFoundError: javax/el/ExpressionFactory
at
java.lang.Class.getDeclaredConstructors0(Native Method)
at
java.lang.Class.privateGetDeclaredConstructors (
Class.java:2389)
at
java.lang.Class.getConstructor0 (
Class.java:2699)
at
java.lang.Class.newInstance0 (
Class.java:326)
at
java.lang.Class.newInstance (
Class.java:308)
at
org.apache.catalina.core.StandardContext.listenerStart (
StandardContext.java:3744)
at
org.apache.catalina.core.StandardContext.start (
StandardContext.java:4252)
at
org.apache.catalina.manager.ManagerServlet.start (
ManagerServlet.java:1173)
at
org.apache.catalina.manager.HTMLManagerServlet.start (
HTMLManagerServlet.java:549)
at
org.apache.catalina.manager.HTMLManagerServlet.doGet (
HTMLManagerServlet.java:105)
at
javax.servlet.http.HttpServlet.service (
HttpServlet.java:627)
at
javax.servlet.http.HttpServlet.service (
HttpServlet.java:729)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (
ApplicationFilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter (
ApplicationFilterChain.java:188)
at
org.apache.catalina.core.StandardWrapperValve.invoke (
StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke (
StandardContextValve.java:172)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke (
AuthenticatorBase.java:525)
at
org.apache.catalina.core.StandardHostValve.invoke (
StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke (
ErrorReportValve.java:117)
at
org.apache.catalina.core.StandardEngineValve.invoke (
StandardEngineValve.java:108)
at
org.apache.catalina.connector.CoyoteAdapter.service (
CoyoteAdapter.java:174)
at
org.apache.coyote.http11.Http11Processor.process (
Http11Processor.java:873)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (
PoolTcpEndpoint.java:528)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt (
LeaderFollowerWorkerThread.java:81)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at
java.lang.Thread.run (
Thread.java:619)
Caused by:
java.lang.ClassNotFoundException:
javax.el.ExpressionFactory at
org.apache.catalina.loader.WebappClassLoader.loadClass (
WebappClassLoader.java:1386)
at
org.apache.catalina.loader.WebappClassLoader.loadClass (
WebappClassLoader.java:1232)
at
java.lang.ClassLoader.loadClassInternal (
ClassLoader.java:316)
... 27 more
and the application is not started.
abhishek
On Tue, Aug 31, 2010 at 8:44 PM, abhishek jain
<abhishek.netjain@(protected):
> Hi friends,
> I have a website in struts 1.2 hosted on tomcat 5.5.x and it uses EL.
> It is not being evaluated, any suggestions on the reasons why?
>
> I used struts 1.2 , myeclipse, tomcat 5.5.28 .
> EL is not working on live but works on development environment on
> myeclipse.
>
> I have tried changing the web.xml to 2.4 from 2.5 etc.
>
> Pl. help.
> --
> Thanks and kind Regards,
> Abhishek jain
>

Attachment:
user_207334.ezm (zipped)Hey ,
I just realized i acidently placed el-api.jar in WEB-INF/lib folder.
If i dont than i get the following exception:
Aug 31, 2010 4:28:44 PM
org.apache.catalina.core.StandardContextlistenerStart
SEVERE: Error configuring application listener of class
com.sun.faces.config.ConfigureListenerjava.lang.NoClassDefFoundError: javax/el/ExpressionFactory
at
java.lang.Class.getDeclaredConstructors0(Native Method)
at
java.lang.Class.privateGetDeclaredConstructors (
Class.java:2389)
at
java.lang.Class.getConstructor0 (
Class.java:2699)
at
java.lang.Class.newInstance0 (
Class.java:326)
at
java.lang.Class.newInstance (
Class.java:308)
at
org.apache.catalina.core.StandardContext.listenerStart (
StandardContext.java:3744)
at
org.apache.catalina.core.StandardContext.start (
StandardContext.java:4252)
at
org.apache.catalina.manager.ManagerServlet.start (
ManagerServlet.java:1173)
at
org.apache.catalina.manager.HTMLManagerServlet.start (
HTMLManagerServlet.java:549)
at
org.apache.catalina.manager.HTMLManagerServlet.doGet (
HTMLManagerServlet.java:105)
at
javax.servlet.http.HttpServlet.service (
HttpServlet.java:627)
at
javax.servlet.http.HttpServlet.service (
HttpServlet.java:729)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (
ApplicationFilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter (
ApplicationFilterChain.java:188)
at
org.apache.catalina.core.StandardWrapperValve.invoke (
StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke (
StandardContextValve.java:172)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke (
AuthenticatorBase.java:525)
at
org.apache.catalina.core.StandardHostValve.invoke (
StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke (
ErrorReportValve.java:117)
at
org.apache.catalina.core.StandardEngineValve.invoke (
StandardEngineValve.java:108)
at
org.apache.catalina.connector.CoyoteAdapter.service (
CoyoteAdapter.java:174)
at
org.apache.coyote.http11.Http11Processor.process (
Http11Processor.java:873)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (
PoolTcpEndpoint.java:528)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt (
LeaderFollowerWorkerThread.java:81)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at
java.lang.Thread.run (
Thread.java:619)
Caused by:
java.lang.ClassNotFoundException:
javax.el.ExpressionFactory at
org.apache.catalina.loader.WebappClassLoader.loadClass (
WebappClassLoader.java:1386)
at
org.apache.catalina.loader.WebappClassLoader.loadClass (
WebappClassLoader.java:1232)
at
java.lang.ClassLoader.loadClassInternal (
ClassLoader.java:316)
... 27 more
and the application is not started.
abhishek
On Tue, Aug 31, 2010 at 8:44 PM, abhishek jain
<abhishek.netjain@(protected):
> Hi friends,
> I have a website in struts 1.2 hosted on tomcat 5.5.x and it uses EL.
> It is not being evaluated, any suggestions on the reasons why?
>
> I used struts 1.2 , myeclipse, tomcat 5.5.28 .
> EL is not working on live but works on development environment on
> myeclipse.
>
> I have tried changing the web.xml to 2.4 from 2.5 etc.
>
> Pl. help.
> --
> Thanks and kind Regards,
> Abhishek jain
>

Attachment:
user_207346.ezm (zipped)On Tue, Aug 31, 2010 at 9:01 PM, abhishek jain
<abhishek.netjain@(protected):
> Hey ,
> I just realized i acidently placed el-api.jar in WEB-INF/lib folder.
> If i dont than i get the following exception:
>
>
> Aug 31, 2010 4:28:44 PM
org.apache.catalina.core.StandardContext> listenerStart
> SEVERE: Error configuring application listener of class
>
com.sun.faces.config.ConfigureListener>
java.lang.NoClassDefFoundError: javax/el/ExpressionFactory
> at
java.lang.Class.getDeclaredConstructors0(Native Method)
> at
java.lang.Class.privateGetDeclaredConstructors (
Class.java:2389)
> at
java.lang.Class.getConstructor0 (
Class.java:2699)
> at
java.lang.Class.newInstance0 (
Class.java:326)
> at
java.lang.Class.newInstance (
Class.java:308)
> at
>
org.apache.catalina.core.StandardContext.listenerStart (
StandardContext.java:3744)
> at
>
org.apache.catalina.core.StandardContext.start (
StandardContext.java:4252)
> at
>
org.apache.catalina.manager.ManagerServlet.start (
ManagerServlet.java:1173)
> at
>
org.apache.catalina.manager.HTMLManagerServlet.start (
HTMLManagerServlet.java:549)
> at
>
org.apache.catalina.manager.HTMLManagerServlet.doGet (
HTMLManagerServlet.java:105)
> at
javax.servlet.http.HttpServlet.service (
HttpServlet.java:627)
> at
javax.servlet.http.HttpServlet.service (
HttpServlet.java:729)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (
ApplicationFilterChain.java:269)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter (
ApplicationFilterChain.java:188)
> at
>
org.apache.catalina.core.StandardWrapperValve.invoke (
StandardWrapperValve.java:213)
> at
>
org.apache.catalina.core.StandardContextValve.invoke (
StandardContextValve.java:172)
> at
>
org.apache.catalina.authenticator.AuthenticatorBase.invoke (
AuthenticatorBase.java:525)
> at
>
org.apache.catalina.core.StandardHostValve.invoke (
StandardHostValve.java:127)
> at
>
org.apache.catalina.valves.ErrorReportValve.invoke (
ErrorReportValve.java:117)
> at
>
org.apache.catalina.core.StandardEngineValve.invoke (
StandardEngineValve.java:108)
> at
>
org.apache.catalina.connector.CoyoteAdapter.service (
CoyoteAdapter.java:174)
> at
>
org.apache.coyote.http11.Http11Processor.process (
Http11Processor.java:873)
> at
>
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
> at
>
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (
PoolTcpEndpoint.java:528)
> at
>
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt (
LeaderFollowerWorkerThread.java:81)
> at
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
> at
java.lang.Thread.run (
Thread.java:619)
> Caused by:
java.lang.ClassNotFoundException:
javax.el.ExpressionFactory> at
>
org.apache.catalina.loader.WebappClassLoader.loadClass (
WebappClassLoader.java:1386)
> at
>
org.apache.catalina.loader.WebappClassLoader.loadClass (
WebappClassLoader.java:1232)
> at
java.lang.ClassLoader.loadClassInternal (
ClassLoader.java:316)
> ... 27 more
>
>
>
> and the application is not started.
>
>
> abhishek
>
>
> On Tue, Aug 31, 2010 at 8:44 PM, abhishek jain <abhishek.netjain@(protected)
> > wrote:
>
>> Hi friends,
>> I have a website in struts 1.2 hosted on tomcat 5.5.x and it uses EL.
>> It is not being evaluated, any suggestions on the reasons why?
>>
>> I used struts 1.2 , myeclipse, tomcat 5.5.28 .
>> EL is not working on live but works on development environment on
>> myeclipse.
>>
>> I have tried changing the web.xml to 2.4 from 2.5 etc.
>>
>> Pl. help.
>> --
>> Thanks and kind Regards,
>> Abhishek jain
>>
>
>
any comments?
Pl. help,
thanks
abhishek

Attachment:
user_207335.ezm (zipped)Hi folks,
I have an struts2.0.14 app working well and I decided to migrate to
struts2.1.8. Migration worked well.
But when I tried to include rest plugin, my current urls to process some
actions don't work. I have a http 404 error as a result. My goal is using
restful to publish some methods located in my service package, offcourse
creating a controller first.
Do you know why my app doesn't work when I include restful plugin jar?. I
suppose it can't process current urls like
http://localhost:8080/myApp/runLogin.action
I have noticed that struts2 blank app works well and struts2 rest showcase
too... But when I'm trying to include restful plugin in struts2 blank app,
it doesn't work. When I'm trying to access to
http://localhost:8080/strutsapp/index.action, a http 404 error happens.
How can i solve this issue? My goal is to use restful in my actual struts
app. I googled and some opinions is that restful plugin is incompatible with
some traditional struts2 apps, is that true?
Thanks in advance
Bye
--
Rafael Taboada
Software Engineer
Cell : +511-992741026
"No creo en el destino pues no me gusta tener la idea de controlar mi vida"

Attachment:
user_207336.ezm (zipped)I've just noticed, that rest plugin change the way how i can access to a
specific action.
When i use http://localhost:8080/myApp/runLogin.action, action mapping is
failing. It thinks it is a restful method. and I can access the action
putting http://localhost:8080/myApp/runLogin!execute
Is there a chance to my traditional actions can co-exist with restful
controllers?... I mean, http://localhost:8080/myApp/runLogin.action goes to
my login page... http://localhost:8080/myApp/service/folder/145 goes to my
restful controller folderController calling the 'show' method.
Thanks in advance
On Tue, Aug 31, 2010 at 12:04 PM, Rafael Taboada
<kaliman.forever@(protected):
> Hi folks,
>
> I have an struts2.0.14 app working well and I decided to migrate to
> struts2.1.8. Migration worked well.
>
> But when I tried to include rest plugin, my current urls to process some
> actions don't work. I have a http 404 error as a result. My goal is using
> restful to publish some methods located in my service package, offcourse
> creating a controller first.
>
> Do you know why my app doesn't work when I include restful plugin jar?. I
> suppose it can't process current urls like
> http://localhost:8080/myApp/runLogin.action
>
> I have noticed that struts2 blank app works well and struts2 rest showcase
> too... But when I'm trying to include restful plugin in struts2 blank app,
> it doesn't work. When I'm trying to access to
> http://localhost:8080/strutsapp/index.action, a http 404 error happens.
>
> How can i solve this issue? My goal is to use restful in my actual struts
> app. I googled and some opinions is that restful plugin is incompatible with
> some traditional struts2 apps, is that true?
>
> Thanks in advance
>
> Bye
>
> --
> Rafael Taboada
> Software Engineer
>
> Cell : +511-992741026
>
> "No creo en el destino pues no me gusta tener la idea de controlar mi vida"
>
--
Rafael Taboada
Software Engineer
Cell : +511-992741026
"No creo en el destino pues no me gusta tener la idea de controlar mi vida"

Attachment:
user_207337.ezm (zipped)On 8/31/10 1:04 PM, Rafael Taboada wrote:
> I have an struts2.0.14 app working well and I decided to migrate to
> struts2.1.8. Migration worked well.
>
> But when I tried to include rest plugin, my current urls to process some
> actions don't work. I have a http 404 error as a result. My goal is using
> restful to publish some methods located in my service package, offcourse
> creating a controller first.
Did you read through the 2.0 -> 2.1 migration document? In particular
you might be affected by how you're getting the parameters into your
action -- I believe there are now several params interceptors where
there used to be just one.
https://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html#TroubleshootingguidemigratingfromStruts2.0.xto2.1.x-ActionMappingParams
Any reason if you're choosing to upgrade to target 2.1 instead of 2.2?
-Dale

Attachment:
user_207338.ezm (zipped)On 8/31/10 2:05 PM, Rafael Taboada wrote:
> Is there a chance to my traditional actions can co-exist with restful
> controllers?...
If you're looking to have different parts of your url space get
processed by different action mappers, the PrefixBasedActionMapper
included in 2.2 might be what you're looking for. Yes, if you include
that class in your own codebase you can use it in a 2.1 environment.
https://issues.apache.org/jira/browse/WW-3260
-Dale

Attachment:
user_207339.ezm (zipped)Thanks so much for your answer.
I migrated my app to 2.1 because I need to use restful plugin, didn't think
in 2.2 because it was released just a month ago (i think) and i don't know
if it is a good option in production environment.
I'll consider your advice. Thanks
On Tue, Aug 31, 2010 at 1:21 PM, Dale Newfield <dale@(protected):
> On 8/31/10 2:05 PM, Rafael Taboada wrote:
>
>> Is there a chance to my traditional actions can co-exist with restful
>> controllers?...
>>
>
> If you're looking to have different parts of your url space get processed
> by different action mappers, the PrefixBasedActionMapper included in 2.2
> might be what you're looking for. Yes, if you include that class in your
> own codebase you can use it in a 2.1 environment.
>
> https://issues.apache.org/jira/browse/WW-3260
>
> -Dale
>
--
Rafael Taboada
Software Engineer
Cell : +511-992741026
"No creo en el destino pues no me gusta tener la idea de controlar mi vida"

Attachment:
user_207340.ezm (zipped)On 8/31/10 3:15 PM, Rafael Taboada wrote:
> I migrated my app to 2.1 because I need to use restful plugin, didn't
> think in 2.2 because it was released just a month ago (i think) and i
> don't know if it is a good option in production environment.
Theoretically any GA (General Availability) release is of sufficient
quality to run in production, and the newer releases will have both more
capabilities as well as better performance characteristics. If you
experience any issues, please ask here and/or submit a detailed JIRA issue.
-Dale

Attachment:
user_207341.ezm (zipped)Hi,
I've been looking at PrefixBasedActionMapper. What is the way to configure
it?
I have in my struts.xml
<bean type="
org.apache.struts2.dispatcher.mapper.ActionMapper"
name="pseudoRestful"
class="
org.apache.struts2.dispatcher.mapper.Restful2ActionMapper"/>
<constant name="struts.mapper.class"
value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
<constant name="struts.mapper.prefixMapping"
value="/service:pseudoRestful,:struts"/>
It means, every url that contains 'service' must be mapped with
Restful2ActionMapper, everything else use default mapping.
Is that correct? What am i missing or doing wrong?
On Tue, Aug 31, 2010 at 2:37 PM, Dale Newfield <dale@(protected):
> On 8/31/10 3:15 PM, Rafael Taboada wrote:
>
>> I migrated my app to 2.1 because I need to use restful plugin, didn't
>> think in 2.2 because it was released just a month ago (i think) and i
>> don't know if it is a good option in production environment.
>>
>
> Theoretically any GA (General Availability) release is of sufficient
> quality to run in production, and the newer releases will have both more
> capabilities as well as better performance characteristics. If you
> experience any issues, please ask here and/or submit a detailed JIRA issue.
>
> -Dale
>
--
Rafael Taboada
Software Engineer
Cell : +511-992741026
"No creo en el destino pues no me gusta tener la idea de controlar mi vida"

Attachment:
user_207342.ezm (zipped)On 8/31/10 4:40 PM, Rafael Taboada wrote:
> I have in my struts.xml
> <bean type="
org.apache.struts2.dispatcher.mapper.ActionMapper"
> name="pseudoRestful"
> class="
org.apache.struts2.dispatcher.mapper.Restful2ActionMapper"/>
> <constant name="struts.mapper.class"
> value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
> <constant name="struts.mapper.prefixMapping"
> value="/service:pseudoRestful,:struts"/>
>
> It means, every url that contains 'service' must be mapped with
> Restful2ActionMapper, everything else use default mapping.
>
> Is that correct? What am i missing or doing wrong?
Almost. It means that every request that starts with "/service/"
(ignoring context root) will first be mapped using the
Restful2ActionMapper, if that fails, then it'll be mapped by the
standard struts DefaultActionMapper. Anything that doesn't start with
"/service/" will just be mapped by the standard struts DefaultActionMapper.
-Dale

Attachment:
user_207343.ezm (zipped)Great,
But I'm having the same problem "HTTP status 404"
I've downloaded struts-blank2.2.1 and added jars about restful plugin
(struts2-rest-showcase-2.2.1)
My struts.xml looks like :
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<constant name="struts.devMode" value="false" />
<bean type="
org.apache.struts2.dispatcher.mapper.ActionMapper"
name="pseudoRestful"
class="
org.apache.struts2.dispatcher.mapper.Restful2ActionMapper"/>
<constant name="struts.mapper.class"
value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
<constant name="struts.mapper.prefixMapping"
value="service:pseudoRestful,:struts"/>
<include file="example.xml"/>
<package name="default" namespace="/" extends="struts-default">
<default-action-ref name="index" />
<action name="index">
<result type="redirectAction">
<param name="actionName">HelloWorld</param>
<param name="namespace">/example</param>
</result>
</action>
</package>
<!-- Add packages here -->
</struts>
And when I try to acces
http://localhost:8080/struts221/example/HelloWorld.action, apparently it is
driven by restful, because it shows "HTTP status 404" error
Maybe i'm missing another config? What am I doing wrong?
On Tue, Aug 31, 2010 at 4:05 PM, Dale Newfield <dale@(protected):
> On 8/31/10 4:40 PM, Rafael Taboada wrote:
>
>> I have in my struts.xml
>> <bean type="
org.apache.struts2.dispatcher.mapper.ActionMapper"
>> name="pseudoRestful"
>> class="
org.apache.struts2.dispatcher.mapper.Restful2ActionMapper"/>
>> <constant name="struts.mapper.class"
>> value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>> <constant name="struts.mapper.prefixMapping"
>> value="/service:pseudoRestful,:struts"/>
>>
>> It means, every url that contains 'service' must be mapped with
>> Restful2ActionMapper, everything else use default mapping.
>>
>> Is that correct? What am i missing or doing wrong?
>>
>
> Almost. It means that every request that starts with "/service/" (ignoring
> context root) will first be mapped using the Restful2ActionMapper, if that
> fails, then it'll be mapped by the standard struts DefaultActionMapper.
> Anything that doesn't start with "/service/" will just be mapped by the
> standard struts DefaultActionMapper.
>
> -Dale
>
--
Rafael Taboada
Software Engineer
Cell : +511-992741026
"No creo en el destino pues no me gusta tener la idea de controlar mi vida"

Attachment:
user_207344.ezm (zipped)Hi,
I was debugging PrefixBasedActionMapper and a I noticed that:
- It gets the right actionmappers
"/service" ->
org.apache.struts2.dispatcher.mapper.Restful2ActionMapper@(protected)
"" ->
org.apache.struts2.dispatcher.mapper.DefaultActionMapper@(protected)
- When I can access the uri /example/HelloWorld.action it takes the
defaultActionMapper
Using ActionMapper
org.apache.struts2.dispatcher.mapper.DefaultActionMapper@(protected)
- but in the line "ActionMapping actionMapping =
actionMapper.getMapping(request, configManager);" it returns NULL
ActionMapper
org.apache.struts2.dispatcher.mapper.DefaultActionMapper@(protected)
return an ActionMapping
And the log "no ActionMapper found"
Any comment about this?
Thanks in advance
On Tue, Aug 31, 2010 at 4:17 PM, Rafael Taboada
<kaliman.forever@(protected):
> Great,
>
> But I'm having the same problem "HTTP status 404"
>
> I've downloaded struts-blank2.2.1 and added jars about restful plugin
> (struts2-rest-showcase-2.2.1)
>
> My struts.xml looks like :
>
> <struts>
>
> <constant name="struts.enable.DynamicMethodInvocation" value="true" />
> <constant name="struts.devMode" value="false" />
>
> <bean type="
org.apache.struts2.dispatcher.mapper.ActionMapper"
> name="pseudoRestful"
> class="
org.apache.struts2.dispatcher.mapper.Restful2ActionMapper"/>
> <constant name="struts.mapper.class"
> value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
> <constant name="struts.mapper.prefixMapping"
> value="service:pseudoRestful,:struts"/>
>
>
> <include file="example.xml"/>
>
>
>
> <package name="default" namespace="/" extends="struts-default">
> <default-action-ref name="index" />
> <action name="index">
> <result type="redirectAction">
> <param name="actionName">HelloWorld</param>
> <param name="namespace">/example</param>
> </result>
> </action>
> </package>
>
> <!-- Add packages here -->
>
> </struts>
>
> And when I try to acces
> http://localhost:8080/struts221/example/HelloWorld.action, apparently it
> is driven by restful, because it shows "HTTP status 404" error
>
> Maybe i'm missing another config? What am I doing wrong?
>
>
>
> On Tue, Aug 31, 2010 at 4:05 PM, Dale Newfield <dale@(protected):
>
>> On 8/31/10 4:40 PM, Rafael Taboada wrote:
>>
>>> I have in my struts.xml
>>> <bean type="
org.apache.struts2.dispatcher.mapper.ActionMapper"
>>> name="pseudoRestful"
>>> class="
org.apache.struts2.dispatcher.mapper.Restful2ActionMapper"/>
>>> <constant name="struts.mapper.class"
>>> value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>>> <constant name="struts.mapper.prefixMapping"
>>> value="/service:pseudoRestful,:struts"/>
>>>
>>> It means, every url that contains 'service' must be mapped with
>>> Restful2ActionMapper, everything else use default mapping.
>>>
>>> Is that correct? What am i missing or doing wrong?
>>>
>>
>> Almost. It means that every request that starts with "/service/"
>> (ignoring context root) will first be mapped using the Restful2ActionMapper,
>> if that fails, then it'll be mapped by the standard struts
>> DefaultActionMapper. Anything that doesn't start with "/service/" will just
>> be mapped by the standard struts DefaultActionMapper.
>>
>> -Dale
>>
>
>
>
> --
> Rafael Taboada
> Software Engineer
>
> Cell : +511-992741026
>
> "No creo en el destino pues no me gusta tener la idea de controlar mi vida"
>
--
Rafael Taboada
Software Engineer
Cell : +511-992741026
"No creo en el destino pues no me gusta tener la idea de controlar mi vida"

Attachment:
user_207345.ezm (zipped)On 8/31/10 5:17 PM, Rafael Taboada wrote:
> But I'm having the same problem "HTTP status 404"
So it is failing to find any valid action mapping? What do your logs show?
This might help you figure out what's going on:
http://struts.apache.org/2.x/docs/config-browser-plugin.html
> My struts.xml looks like :
> <include file="example.xml"/>
I don't know what's in that file--I'm guessing a package with the
namespace "/example"? Do you have any packages whose namespace is
"/service"?
> <package name="default" namespace="/" extends="struts-default">
I've not looked into the details of the plugins you said you're using.
Do any of them provide packages that you need to extend instead of
struts-default to get their benefits?
> <result type="redirectAction">
> <param name="actionName">HelloWorld</param>
> <param name="namespace">/example</param>
So if you try to access /index.action, does it redirect to
/example/HellowWorld.action ?
> And when I try to acces
> http://localhost:8080/struts221/example/HelloWorld.action, apparently it
> is driven by restful, because it shows "HTTP status 404" error
Your configuration doesn't specify that this should be mapped by the
Restful2ActionMapper, so why do you assume this?
> Maybe i'm missing another config? What am I doing wrong?
I don't know how the Restful2ActionMapper does it's thing. When I
looked at the two provided Restful action mappers several years ago I
found that neither really did what I needed, so I ended up writing my
own. I've actually found that most of what people want when they say
they want REST style urls can be provided by the default action mapper
with wildcards. (Also, make sure that you have SlashesInActionNames set
appropriately for the rest of your config.)
http://struts.apache.org/2.x/docs/restfulactionmapper.html and/or
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.html
should be helpful.
-Dale