Re: Obtaining the value of struts.action.extension in a struts2 nterceptor
Thanks! This works like a charm. Musachy Barroso wrote: > > add this to your interceptor > > @Inject(StrutsConstants.STRUTS_ACTION_EXTENSION) > public void setExtension(Strtin ext) {} > > musachy > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > > -- View this message in context: http://www.nabble.com/Obtaining-the-value-of-struts.action.extension-in-a-struts2-interceptor-tp23762699p23763082.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Obtaining the value of struts.action.extension in a struts2 nterceptor
I have a need to obtain the value of struts.action.extension in an interceptor. Browsing around the source code with a debugger isn't getting me anywhere. Can anyone suggest a way to access the struts.xml constant definitions in the context of an interceptor? -- View this message in context: http://www.nabble.com/Obtaining-the-value-of-struts.action.extension-in-a-struts2-nterceptor-tp23762699p23762699.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Render Saved Action Parameters
I have an interceptor that is saving the state of certain action calls for the purpose of rendering breadcrumbs in the UI. The interceptor is successfully saving a map of parameters from the invocation context and storing them in the user's session. What I can't figure out is how to render a URL that includes the saved set of parameters dynamically. The url tag only offers a static set of parameters and does not seem to allow me to dynamically determine what the parameter names and values are. The documentation makes a tantalising mention of "If the value of a param is an Array or an Iterable all the values will be added to the URL." but I don't think that this is quite what I want to do, I want different values for the parameter names as well as their values. I'd really rather not rewrite the URL rewriting code in a custom freemarker template but I cannot figure out how best to reuse the existing code to avoid rewriting it. Would anybody be able to point me in the direction of a possible solution? -- View this message in context: http://www.nabble.com/Render-Saved-Action-Parameters-tp23573783p23573783.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
ModelDrivenInterceptor not refreshing model for Struts2
I have a ModelDrivenInterceptor set up as follows in struts.xml: true My save method in my action is as follows: /** * Create or update the entity. * * @return Show */ public String save() { LOG.debug("save() Called"); setEntity(getDao().save(entity)); return SHOW; } The DAO is using Hibernate via JPA. However the entity is never replaced on the value stack. Digging a little further in the debugger I get to the following code on lines 114-116 of ModelDrivenInterceptor: if (item == newModel) { needsRefresh = false; } Now the debugger tells me that those two variables have different object identities. newModel has the ID of the entity set from the database save and item does not. However for some reason Java is saying that the two variables are == to each other which is clearly not the case. Definitely weird. Can anyone suggest what might be going on? My only thought is that there is some weirdness going on with the Hibernate CGLIB enhanced model objects. Peter Kelley -- View this message in context: http://www.nabble.com/ModelDrivenInterceptor-not-refreshing-model-for-Struts2-tp23227918p23227918.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Action Validation with Slashes
We have an issue where we are trying to set up validation.xml files for action invocations that contain slashes. From running a debugger on the XWork code it would appear that if action com.mycompany.action.MyAction is being executed via the url /context-root/package/MyAction/operation.action that the XWork validation framework is looking for a file in the classpath of the form: com/mycompany/action/MyAction-package/MyAction/operation-validation.xml This is an invalid java package name in the jar (no - characters allowed) and so even if the validation.xml file is named appropriately and placed in the appropriate directory it is failing to be found. The culprit appears to be 2 lines in com.opensymphony.xwork.validator.AnnotationActionValidatorManager: String fileName = aClass.getName().replace('.', '/') + "-" + context + VALIDATION_CONFIG_SUFFIX; and String fileName = aClass.getName().replace('.', '/') + VALIDATION_CONFIG_SUFFIX; should I be raising a Jira issue for this? Peter Kelley Fujitsu Australia Limited -- View this message in context: http://www.nabble.com/Action-Validation-with-Slashes-tp17245638p17245638.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Context Root for Image Button src attribute
I am trying to write an image button of the form: where context-root is the configured context root of my web application. Can anyone suggest a good way to dynamically populate the context root? I am assuming that the src string is being interpreted via OGNL but I can't figure out an appropriate expression to use to extract the context root from the request. -- View this message in context: http://www.nabble.com/Context-Root-for-Image-Button-src-attribute-tp16952908p16952908.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]