I've implemented custom WebWork action. For it I've supplied some velocity templates.
How can I add custom parameters to velocity? I didn'f find any such method :(
If you add private variables in the action and getter methods for them in the action class, they are accessible from the velocity template. Is this what you want?
Yep, I think that's just it! Thanks a lot!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One more question: if I have to add to velocity context standard jira components - for example, webResourceManager - should I write something like:
public WebResourceManager getWebResourceManager(){
return ComponentManager.getInstance().getWebResourceManager();
}
It looks like overhead :-/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you add private variables in the action and getter methods for them in the action class, they are accessible from the velocity template. Is this what you want?
Hi Jobin,
Can you give an example for this?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Example for getter/setters? If you have variable xyz and getter/setters for it, you can access it in velocity template as $xyz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you missing 's'? Try
<p>size : $crman.relationSchemes.size() </p>
You can also use
<p>size : $crman.getRelationSchemes().size() </p>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can access with action like
#set ($crman = $action.relationManager)
then, I want to access its variables as folows:
<p>size : $crman.relationScheme.size() </p>
I have a getRelationSchemes() methods in it, but I am always getting zero. What is wrong with this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.