Upload files by GWT to Rails server - ruby-on-rails-3

I am working on an app that I need to upload files using GWT in the client side, then a servlet receives the uploaded file. My problem that I need to pass the file from the servlet to the ruby on rails controller (on the same server with the servlet). Any suggestion is appreciated.

I am do not see any particular problem here. Just prepare somewhere a non GWT html page with a form, an input and submit that can send a file to your Rails server. Now everything that you need is to prepare the same form using GWT components. In a case of standart GWT components you can use FormPanel and FileUpload components. Be sure that encoding and method was correctly set (example for built-in GWT components):
FormPanel form = prepareForm();
form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);
// sending file
form.submit();

Related

how to automate principal component analysis and show on a web page, is it possible?

I have result of Dimension reduction using principal component method and I want to show that result on web portal by just making a web page where user select the variable and do analysis. I have ipynb file which is juypter notebook file. any solutions for this ??
Now I got the solution of this---
First convert ipnyb file to py file and read that file in python environment
and run the file.
Output comes up
get http response by using http web client api.
Now Read the output data in any language you are comfort with. as I Read this
using asp .net and python engine and made web portal using this file.

dojo app - caching static content such as imgs/css

Im working on and existing dojo application which is requesting the same static content on every page change.
Is there a way to configure the application so this content is cached?.... i.e so every http request has cache control headers?
This is nothing related with Dojo or any other javascript framework.
You can define the cache control configurations either in the Content Server (Apache / Nginx) or in the application server. (if the content is created by the backend server).

What is the path to signalr hubs when using ElmahR?

I am trying to add some custom functionality to ElmahR dashboard page and having some issues. I have started a new project, added ElmahR dashboard NuGet package. Configured all source applications and it is all working fine as expected.
Now I want to add some custom functionality to the dashboard page. As part of this I needed to add some UI to the dashboard page, a new Hub, JavaScript etc. The custom functionality is not related Error Logging. It is completely different. It is something we would like it to add to the dashboard page. I have added new Hub, JavaScript, HTML markups but it doesn't work as expected.
I ran into the following issues:
When i try to access /signalr/hubs, I get 404 Not found error. I searched online for this error and it usually happens if you haven't configured the Hub route. I tried to add RouteTable.Routes.MapHubs() in global.asax file. However it says that A route named 'signalr.hubs' is already in the route collection. Makes sense because I am using ElmahR and because it relies on SingalR, it would have already added it to the route collection. So what is the path to /singalr/hubs in ElmahR application? When using signalR in your standard asp.net application, the usual path to hubs is /signalr/hubs but what path is it when using ElmahR?
I am getting JavaScript error "Uncaught TypeError: Cannot read property 'client' of undefined" at the line where I am trying to access hub.client. I guess it is failing because it is not able to find the new hub that i added.
Everything works fine if I copy the hub, associated JavaScript and HTML to a different ASP.NET MVC project. For some reasons it does not work with the Project that uses ElmahR. I know there is nothing wrong with the code in Hub and JavaScript as it works fine with a standard ASP.NET MVC project. Basically all I want to do is to add a singalR hub to a project that uses ElmahR. Also I can't seem to figure out the URL path to Hubs in an application that uses ElmahR. Usually the path is /signalr/hubs
UPDATE:
After further investigation, I figured the path to hubs in ElmahR dashboard application. It is /signalr101/hubs. However when requesting this, it errors: "Uncaught Error: SignalR: JavaScript Hub Proxy generation has been disabled". It appears that ElmahR would have disabled JavaScript proxies, probably by setting DisableJavaScriptProxies property of the application's IConfigurationManager to true (https://github.com/SignalR/SignalR/pull/1222). I think because of that I am getting "Uncaught TypeError: Cannot read property 'client' of undefined in my JavaScript at the line where it is trying to access hub.client. If the JavaScript proxy is disabled, then is there any extra work I have to do in my JavaScript and Hub so that I don't get this JavaScript error.

Creating an extension in Yii

I am new to Yii. I have a jquery file manager working with plain PHP script. Now i want to integrate it with Yii Application. The flow is like, from index it will initiate jquery function, which will search for PHP connector script. My problem is, how can i include connector script in Yii so that the Jquery can access it
If you've got the rest of the extension working, then you can create a controller within this extension's directory to handle any actions for it. Then you can use the URL rules in the configuration to send specific URLs to it.
as of now i did not create any extensions, I put the connector script under assets directory and it just worked fine. I am sure this cannot be the best practice. I would like to get help on creating custom extensions for Yii

JSP and Restlets

I developed a simple web servie using restlets . everything s fine i can call a URI and connect to db and do modifications , but when i tried to do the same using jsp s i was not able to get the jsp page itself in the browser . How can i connect a jsp page to this restlet ?
See this stack and the answer from Rich Seller. I personally prefer using Freemarker