Re: [sakai-dev] Re: Develop sakai tool with SpringMVC + Ajax in Sakai 11.4

classic Classic list List threaded Threaded
1 message Options
Hendrik Steller Hendrik Steller
Reply | Threaded
Open this post in threaded view
|

Re: [sakai-dev] Re: Develop sakai tool with SpringMVC + Ajax in Sakai 11.4

Hi,

 

for what it's worth:

Your tool more or less worked for me with my current development setup, which was Linux, openjdk 1.8.0_151,Tomcat 8.5.4 and Sakai version 11.4 (+some custom patches).

 

I built/deployed your tool via "mvn clean compile install sakai:deploy" and then manually copied the api-jar because that didn't work automatically; probably because of the outdated pom.xml which still uses sakai-standard-tool as its parent.

 

Anyway, when I added the tool to a course site and clicked on it, I got a popup displaying the user's name when clicking on the tool.

 

Hendrik

 

 

 

 

On Sonntag, 7. Januar 2018 17:01:32 CET Thach Le wrote:

> Dear,

>

> I have checked the ajax in this sample in Sakai 12.x. It worked

> successfully.

>

> About the sakai 11.4, I found below exception when try to load the ajax

> request:

>

> org.sakaiproject.portal.api.PortalHandlerException:

> java.lang.ArrayIndexOutOfBoundsException

> at

> org.sakaiproject.portal.charon.SkinnableCharonPortal.doGet(SkinnableCharonP

> ortal.java:851) caused by: java.lang.ArrayIndexOutOfBoundsException

> at java.lang.System.arraycopy(Native Method)

> at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:322)

> at

> org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:421

> ) at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:409)

> at

> org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.j

> ava:97) at

> org.sakaiproject.portal.util.ByteArrayServletResponse.writeContent(ByteArra

> yServletResponse.java:303) at

> org.sakaiproject.portal.util.ByteArrayServletResponse.forwardResponse(ByteA

> rrayServletResponse.java:216) ...

>

> Best regards,

>

> Thach Le

>

> On Sun, Jan 7, 2018 at 10:25 PM, Thach Le <[hidden email]> wrote:

> > Dear all,

> >

> > I have found my ajax request in my tool has not worked yet in sakai 11.4.

> > For sakai 11.3, it's still running.

> >

> > I have created a simple tool using Spring to create a controller with

> > below ajax method:

> > --

> >

> > @RequestMapping(value = "/loadAjax", method = RequestMethod.GET)

> > @ResponseBody

> > public String loadAjax() {

> >

> > JsonObject jsonObj = new JsonObject();

> >

> > jsonObj.addProperty("currentSiteId",

> >

> > sakaiProxy.getCurrentSiteId());

> >

> > jsonObj.addProperty("userDisplayName", sakaiProxy.

> >

> > getCurrentUserDisplayName());

> >

> > return jsonObj.toString();

> >

> > }

> >

> > --

> >

> > It is not worked in Sakai 11.4.

> >

> > Please check the full source code at https://github.com/

> > mekongsolution/qms/tree/master/sakai/test-ajax/loadajax.

> >

> > Thanks for your support!

> >

> > Thach Le

 

 

--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/a/apereo.org/group/sakai-dev/.