Madvoc doesn't inject the String for the ActionPath chunk

14 views
Skip to first unread message

BloodySmartie

unread,
Sep 15, 2014, 10:55:16 AM9/15/14
to jod...@googlegroups.com
Hi Jodders,

when i migrate from Jodd 3.5.2 to 3.6 without any other changes, Madvoc doesn't inject the ActionPath Strings for my restful app anymore. As an example, testing the following code with the Url "127.0.0.1/services" lets part1 be null.

@Action("/${part1}")
@InterceptedBy(MMInterceptorStack.class)
@public String viewOnePartMakro() {

System.out.println(part1); //part1 == null here

return "/index";
}

As a debugging procedure, i checked first if the servlet gets the right data, so it's getting injected in the same Action class like this:
@In(scope = ScopeType.SERVLET)
HttpServletRequest servletRequest;

And, as i would expect it, servletRequest.requestDispatcherPath contains the MessageBytes "/services". 

So, i suppose something's going wrong in Madvoc, but i've got no idea what it may be :) I'd be thankful for some advice.

Best wishes,

David

Jodders

unread,
Sep 15, 2014, 4:33:11 PM9/15/14
to jod...@googlegroups.com
Hello David!

Huh, let me try to help you :) I just tried what you did, and it worked for me. This action:

@MadvocAction
public class AllAction {


 
@In
 
String part1;


 
@Action("/${part1}")
 
public void viewOnePartMakro() {
 
System.out.println(part1);
 
}
}


worked just fine. So I would suggest the following:

+ be sure that only 3.6. jar files are deployed, as mixture of old and new jars may be not good
+ turn on the debug log and see if there is a message like this on server startup:

Registering Madvoc action: /${part1} to: com.oblac.gogolog.action.AllAction#viewOnePartMakro

+ Maybe something changed with your interceptor stack (MMInterceptorStack)? Can you try my class from above to see if that worked?

Finally, If you can isolate the problem in few classes, just send it to me, I will be more then happy to help you!

BloodySmartie

unread,
Sep 16, 2014, 2:15:13 AM9/16/14
to jod...@googlegroups.com
Thank you for your effort! After seeing your example, I figured out that the solution is pretty simple: It seems that in earlier versions of Jodd, you didn't have to use the @In - annotation for the String :) It was working fine without that as long as I'm using Madvoc. Now, in v3.6, the annotation has to be there. I added it, and my code works again :) 

Thanks a lot!

Jodders

unread,
Sep 16, 2014, 3:52:02 AM9/16/14
to jod...@googlegroups.com
No problem - I was not aware of that behavior in 3.5.2 :) Great it was not a big issue! Enjoy!
Reply all
Reply to author
Forward
0 new messages