I'm using struts2 in my jsp.
I need to externalize my labels in jsp into a properties file.
Can anyone tell me how to externalize the label names in properties file in struts2.
Any examples will help lot.
This page from the official beginners tutorial explains how to do it and has examples:
http://struts.apache.org/2.x/docs/message-resource-files.html
Be sure to go through the rest of the tutorial. It is the best place to start when learning Struts2.
Related
I'm using swagger to make a documentation to my API in ASP.NET Core.
And, I would like to use the shared layout to get the same menu on the top of the documentation page.
I would love to do it without re-creating a custom css file, like the documentation says.
I just hope that someone though the same as me, and I was wondering how.
Thanks in advance,
I’m trying to understand how the Convention plugin determines when to do URL interpretation. In some REST Plug-in examples I see PrefixBasedActionMapper configured with ”/rest:rest,:struts” and it seems that Convention is only applied to the rest mapper and not the DefaultActionMapper. Is this correct? Either way, under what conditions does the Convention plugin kick in for requests?
I’ve been googling like a mad-man these last two days and can’t seem to find any explanation. Inspecting the plugin source didn't give any insights either.
They are different. Convention Plugin is not about URL/action mapping. It just search java classes and create action configs from them.
However, you can tell the plugin to search specific root packages using the property struts.convention.action.packages. e.g.
<constant name="struts.convention.action.packages" value="com.mycompany.myactions.myconvention.*"/>
I want a workflow/webflow plugin that needs to be integrated with an existing Struts2 application.
I found Struts-workflow-extension but looking in its source code I realized it is entirely based on the Struts1 and have there is no support for this plugin since 2003.
Basically my requirement is to handle the entire workflow through configurations that could be done at runtime. Spring webflow is also an option but it's much of a learning curve depending on the deadline that I have to meet.
So is there any workflow/webflow extension that can be easily integrated with Struts2?
Any help will be highly appreciated. Thanks
You can try https://github.com/aleksandr-m/struts2-actionflow which seems to be more up to date.
I want to know why Annotations are preferred over XML in Struts2 Applications?
It's easier to refactor code with annotations than refactor code and then find out you broke your application because you forgot to change the XML file. This is more of a general answer than just for Struts 2, though.
I'm working on on a site built using struts2. The vast majority of our targets generate xml, so mapping the result to a jsp page makes sense. A couple of our targets actually generated binaries. I'm wondering if there is a convenient way to say that the result should come from a servlet/controller instead of a jsp.
Obviously this could be done by modifying the web.xml so the struts filter doesn't apply to those targets and mapping those targets as servlets, but this is non-ideal. Currently, the struts filter applies to the entire site, and we would like to keep it that way.
Ideas?
Thanks!
I am not sure I understand you scenario, but it seems to me you want the Stream Result
Here you can find an excellent tutorial with code examples about Struts2 file upload and file download that covers the Stream Result:
http://www.jeetrainers.com/struts2-course/chapter12-13-1-1#slide