i am trying to retreive the static variable results from my java class into velocity template
case ADDCOMMENT :
System.out.print("in switch");
System.out.println("len : "+len);
String temp = null ;
String finalcomment ="";
int i;
if (len<4)
{
results=bundle.getString("cli.action.default");
System.out.println(bundle.getString("cli.action.default"));
}
else{
System.out.println(str1[2]+"comment"+str1[3]+ "appending" + temp);
for(i=3;i<len;i++){
finalcomment = finalcomment+" "+str1[i];
System.out.println("str1[i]"+str1[i].toString());
}
results = cli.addComment(str1[2],finalcomment);
System.out.println("outpput "+results);
}
break;
i have added getters and setters for resutls
this is my velocity template index.vm I get the error ReferenceError: $finalResult is not defined. Where am i goin wrong? This is a web item plugin
<script Language="JavaScript"> var fResult = $finalResult; alert(fResult); } </script> Logs: <br><textarea rows="15" cols="10" name="Logs" id="Logs" readonly></textarea>
Solved! Go to Solution.
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Apply agile practices
Transform how you manage your work with agile practices, including kanban and scrum frameworks.
Learning Path
Configure agile boards for Jira projects
Plan, prioritize, and estimate upcoming work by creating and configuring agile Jira boards for company-managed projects.
Learning Path
Registered Scrum Basics™
Manage work more effectively by learning scrum basics from a global leader in agile transformation and training—and get credentialed by Scrum Inc.®