Hello,
since a while I'm trying to make Ajax-calls happen in Confluence but everytime I do something that is trying to get data from anywhere, even the confluence-API itself, results in an error. I even tried to use the Ajax-example from the Atlassian Developers page with no desired result.
This is an example of code I'm trying to execute:
AJS.$.ajax({ url: "/rest/gadget/1.0/filtersAndProjects", type: "GET", data: ({projectsOnly : "true"}), dataType: "json", success: function(msg){ alert(msg); } });
And this is the error I recieve everytime im trying to make anything remotely related to Ajaxthings:
Cause org.apache.velocity.exception.ParseErrorException: Encountered "{" at /blabla/email.vm[line 15, column 36] Was expecting one of: <EOF> "(" ... <RPAREN> ... <ESCAPE_DIRECTIVE> ... <SET_DIRECTIVE> ... "##" ... "\\\\" ... "\\" ... <TEXT> ... "*#" ... "*#" ... <STRING_LITERAL> ... <IF_DIRECTIVE> ... <STOP_DIRECTIVE> ... <INTEGER_LITERAL> ... <FLOATING_POINT_LITERAL> ... <WORD> ... <BRACKETED_WORD> ... <IDENTIFIER> ... <DOT> ... "{" ... "}" ... at org.apache.velocity.Template.process(Template.java:141) Stack Trace:[hide] org.apache.velocity.exception.ParseErrorException: Encountered "{" at /blabla/email.vm[line 15, column 36] Was expecting one of: <EOF> "(" ... <RPAREN> ... <ESCAPE_DIRECTIVE> ... <SET_DIRECTIVE> ... "##" ... "\\\\" ... "\\" ... <TEXT> ... "*#" ... "*#" ... <STRING_LITERAL> ... <IF_DIRECTIVE> ... <STOP_DIRECTIVE> ... <INTEGER_LITERAL> ... <FLOATING_POINT_LITERAL> ... <WORD> ... <BRACKETED_WORD> ... <IDENTIFIER> ... <DOT> ... "{" ... "}" ...
followed by a long Stacktrace.
Can anyone help me with this? :(
Community moderators have prevented the ability to post new answers.
old question and you probably worked it out on your own. However I got this issue when my javascript call was directly in my velocity template. the '$' interferes with the server side parsing as both velocity and jquery use this character. I solved it by putting my javascript in a JS file and including it as a web resource.
Are you sure this is Confluence? The "filtersAndProjects" gadget is part of JIRA. Have you registered the filtersAndProjects gadget into your Confluence instance?
Could you please post the full stacktrace?
Have you made any customisations to the source of your Confluence installation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Joseph,
The filtersAndProjects was just an example. It does'nt matter what API I call, it always errors with that message
I made no customisation to Confluence itself (beside my plugin). In this case its a rather empty .vmd and in the head is the script I mentioned before.
Here is the requested Stacktrace: http://pastebin.com/ZwnvApjU
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.