Spring file upload with custom message - spring

Using Spring 3.07
I have this upload form which is pretty much the basic spring example for such. Now it displays a message "No file selected" which is correct. However, I don't want this message. My users expect a message in a different language if at all. Does anybody know how I can get rid of this message?

This has nothing to do with Spring. That message is a browser message for input type file. Mock and scorn reigns down upon me.

Related

A rest service using spring 2 and jersey, unable to get response for some consumers

We have an application that uses asyncresponse and writes the data into a stream.
I upgraded to spring2 from 1.5.
And not sure if it could be releated but now with postman I get this error "Unexpected end of file".
Even in a java client , I get error "java.IO.EOFException: Unexpected end of zlib input stream".
But I get expected result in a curl command.
Now I suspect, this could be something either with user-agent or somewhere in spring2 or jersey , I need to set some properties to get rid of this.
There is no security , I excluded SecurityAutoConfiguration.java, in case somewhere it checks some user-agent.
Because of error I see in java client, I tried with server.compression.enabled=false (which is default anyway), but no luck.
I suppose I need to edit the question.
It seems there is some issue using StreamingOutput using spring2x. This is not streaming which I assumes results in all of above stated issues.
Any help is appreciated.

Esper AMQPSource not receiving events

I'm trying to use the AMQPSource and I'm getting the error describe below, also imports are not working in EPL module. In advance, I test adding full package name to DistanceEvent (events.DistanceEvent and does not work).
To sending a message i'm using the publish Rabbitmq webadmin queue option with the next payload:
{"distance":33}
Could anyone help me?
The "IO-error deserializing object" is the reason you are not seeing data.
The "AMQPToObjectCollectorSerializable" expects the AMQP message to carry a valid JVM-serialized object however the "invalid header" means that the message content cannot be read by the JVM. Check the sender making sure it produces a AMQP message with a JVM-serialized object or may use replace "AMQPToObjectCollectorSerializable" with a deserializer that can understand your message. The code for "AMQPToObjectCollectorSerializable" can be found in Github if your are not sure how it deserializes.

Chromecast sample sender application CastHelloText-chrome ends with error when trying to get session

I have problem with launching Google-Cast application similar to sample CastHelloText-chrome. I slightly modified example code for my specific purposes. The goal for creating this application is to send and show image data directly in Chromecast device.
Particularly the difference between official sample and my code is in message format and its content, sent by sender application. Sender application took png image coded by base64 and send through message bus with custom namespace. Receiver application get this message and use this as data source for html object <img>.
Error appears when I do this steps:
Reload sender page, checking console if any device found.
Send the form by just pushing enter on input box (text is ignored).
Now a popup from Chromecast extension shows. Next there are two scenarios:
3a) I confirm casting to device by choosing one from the list, then I get this error message in console:
onError: {"code":"channel_error","description":"Error: Timeout","details":null}
3b) I just click somewhere else, I get this error:
onError: {"code":"cancel","description":"User closed popup menu","details":null}
Both of errors are caused by calling function chrome.cast.requestSession in chromehellotext.html at line 161, but what's really wrong I don't know.
When I step sender script I realize that function sessionListener is never called. I know that something go wrong when code try to call chrome.cast.requestSession, where described error raises. So I need help if I missed about right way to use Google-Cast API or If this problem has something to do with networking issues.
Receiver application is registered on Google Cast SDK Developer Console and I'm testing on registered device with some serial number. I'm using Google Chrome in version 42.0.2300.2 canary (64-bit) and Chrome version 40.0.2214.111 (current stable I suppose). For testing I also tried to turn off Windows Firewall entirely but with no luck.
Edit:
There were some syntactic errors that caused error message described above.
It seems like you are trying to use the data/control channel to send an image; please don't do that; that channel is not meant to be used for large data communications; in fact it cannot send anything which approaches or exceeds 64k. If your goal is to send images from your local machine, you would need to run a local web server on your local machine and serve images through the web server.
For and easiest tutorial you can have a look to this tutorial.
It is well explained in this tutorial.
Chromecast Sender application
There is no need to maintain session by yourself.
just add button and enjoy casting
mCastManager.addMediaRouterButton(mediaRoutebtn);
I found a source of my problem. There was something wrong in receiver code - syntactic and runtime errors, so I must admit that my code wasn't functional. Now its working in terms of launching application and getting session.
Unfortunate thing is that the error message generated by Chromecast extension didn't match the actual error - at least it was a bit confusing when I didn't know what's really happening on receiver side without ability to debug the code.

Sending file using Spring Batch sftp

I'm trying to send a file with sftp using Spring Batch.
I find a great example/tutorial on this site https://blog.codecentric.de/en/2011/09/send-data-secure-with-sftp-and-spring-batch/ which I followed, though I am getting the "Could not send file per SFTP: ..." caught exception in the example in the link above in the SftpTasklet class. I believe my problem is that the int-sftp:outbound-channel-adapter in my application context is never getting called. The id associated with it sftpOutboundAdapter not referenced anywhere else on the page and I do not see how it gets called. I have found similar tutorials on other sites where it is also never explicitly called.
Basically, my question comes down to: how does the spring batch int-sftp:outbound-channel-adapter get called?
Thanks in advance
The tasklet sends a message (with a File payload) to outputChannel (sftpChannel.send(message);) which, in turn sends it to the outbound adapter.
Turn on DEBUG logging for org.springframework.integration to see the messasge flow.

How do I write to the application window log with MVC

I have a simple MVC application that sometimes fails in production. I would like to write a message to the log that I can view with server manager. It seems like a simple thing to do but I've not found any reference to others doing it.
Can someone please help. I'm stuck "-(
Marie
http://msdn.microsoft.com/en-us/library/6w20x90k.aspx
System.Diagnostices.Eventlog.WriteEntry("Application", "your message here");

Resources