We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@InOut Long id; @Out String bookName; @Action(value = "/book/${id}") // @InterceptedBy(EchoInterceptor.class) public String book() { System.out.println(id); bookName = "Java"; return "#book"; }
http://localhost:8080/book/123 console print 123 and book.jsp render Java it work!
http://localhost:8080/book/123
console
book.jsp
Java
when i add EchoInterceptor
EchoInterceptor
@InOut Long id; @Out String bookName; @Action(value = "/book/${id}") @InterceptedBy(EchoInterceptor.class) public String book() { System.out.println(id); bookName = "Java"; return "#book"; }
http://localhost:8080/book/123 console print null and book.jsp render nothing it not work!
why?
The text was updated successfully, but these errors were encountered:
Check out the MadvocConfig class: https://github.com/oblac/jodd/blob/master/jodd-madvoc/src/main/java/jodd/madvoc/component/MadvocConfig.java#L66
MadvocConfig
By default, ServletConfigInterceptor is the one that those all the @In and @Out magic for you. When you specify the:
ServletConfigInterceptor
@In
@Out
@InterceptedBy(EchoInterceptor.class) public String book() {
you simply didn't use the ServletConfigInterceptor but just the echo one.
Either add the default configurator explicitly:
@InterceptedBy(EchoInterceptor.class, ServletConfigInterceptor.class) public String book() {
OR specify all default ones
@InterceptedBy(EchoInterceptor.class, DefaultWebAppInterceptors.class) public String book() {
OR add echo to default ones:
madvocConfig.setDefaultInterceptors(ew Class[] {EchoInterceptor.class, ServletConfigInterceptor.class};
OR do the same in madvoc.props
madvoc.props
OR create new ActionInterceptorStack
ActionInterceptorStack
and so on :)
Sorry, something went wrong.
There are so many methods to solve the problem
thank you very much!
No branches or pull requests
http://localhost:8080/book/123
console
print 123 andbook.jsp
renderJava
it work!when i add
EchoInterceptor
http://localhost:8080/book/123
console
print null andbook.jsp
render nothing it not work!why?
The text was updated successfully, but these errors were encountered: