Mike Ev

+ Follow
since May 17, 2007
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mike Ev

Hi thanks for the reply. I logged on to the unix server, and used
telnet thehostname 7777
and it seemed to connect ok. I then typed 'ls' and this happened:

<TITLE>501 Method Not Implemented</TITLE>
<H1>Method Not Implemented</H1>
ls to /index.html not supported.<P>
Invalid method in request ls<P>
<ADDRESS>Oracle-Application-Server-10g/ Oracle-HTTP-Server Server at [thehostname] 443</ADDRESS>
Connection closed by foreign host.

[thehostname] was the correct hostname. I'm not familiar with telnet so perhaps that's fine. When typing telnet hostname 443 that has 'connection refused'... a little confused why 443 is appearing in the display above.

In the java program, i put a to show what port the url is (on windows), and its coming up as 7777 still so i would assume thats correct. Wonder why windows can do with this and unix cant. Not that it should matter but the program when on unix is on the same server the url is on.

Any more suggestions?

Oh and using ping seems to work fine, receives several packets.

[ June 12, 2007: Message edited by: Mike Ev ]
[ June 12, 2007: Message edited by: Mike Ev ]
Recently I had been struggling with some code to get a https connection to work. It was coming up with an error that no trusted certificates could be found. I resolved that thanks to some feedback and sites but i've encountered a new problem -- I'm working on the program on Windows and putting into a unix server to be run. This worked fine initially with no problems, then the server changed from http to https, so I had to implement some changes to deal with this -- now however, even though it works fine on windows when put on unix, it throws up this error

java.net.ConnectException: Connection refused

here's the code..

Any ideas why unix isnt liking this? Thanks a lot
its only a small internal program and will only be dealing with 'small' files. Any suggestions on an alternative way round this?
15 years ago

I have a jsp page to upload some files..

The session is used to store a Map ( session.setAttribute("filemap", filemap ) ). This map contains all the files to be uploaded. I have a file-input type, onChange the file here is added to the map. The map is stored in the session and when the page is reloaded, all files in the map can be displayed. Then the user clicks upload, and all the files are uploaded somewhere by some other code.

This works perfectly on my local machine/local host -- on the server however, i've encountered this problem...
When I browse for a file to upload and select it (with the file-input) and the page reloads - files of small file-size will work fine. The page will re-load, the item will be added to the map and displayed on the page. When I select a file with a larger file-size (even 200KB), the page shows a 'page not found' error when it reloads. I'm guessing the session on the server cant hold much space!

Does anyone know how I can get around this? Any help is appreciated!

15 years ago
I had the following code to connect to a site on a server. It worked fine, now the server is using https, which causes the error

javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: Couldn't find trusted certificate

I have saved the certificate for reference and I assume to I need to tell the program to look at that but this will happen every time there is a new certificate (the program needs to look at different servers), so is there a way to trust-all sites or something to get this to work? I've looked on other forums and they mention this but I'm not clear how to do it exactly.

Changing the HttpURLConnection object to HttpsURLConnection throws up a 'java.lang.ClassCastException' error coz its an abstract class.. Any ideas? Thanks a lot
Hiya.. i posted before but heres the prob in more detail..

I'm making a JSP page where (ideally) you select files to upload, each selected file is added to a listbox. The form is submit, (along with some other parameters), and the files are uploaded. They arent uploaded (written) tradionally to a server, I just need the file's input stream to pass to a method elsewhere (which will upload to a database).

The page has a file-input type to locate files to upload. Once a file is selected (onChange()), the filename is added to a listbox and there is a button which submits the form. The form submits to itself (so it will submit to the same jsp page)

On my local machine, I can open the page, select a file and submit -- the page loads fine. When on the web server, when I submit -- the page will go have an error -- the typical 'this page cannot be displayed' error which is shown a page's cant be found. I have absolutely no idea why! To me, it should simply load that page again. Some of the time it does this, and other times (most times) it just turns blank -- I can't work out why.

Similarly when I try to submit (on local machine) and just take the file-input value, eg with and enumerate through and display the value of any files -- it shows the browse button's name but its value is always 'null' even though something was entered there. This won't be a problem if I don't need to get the filename through here to upload it as the other parameters (from the select box) come through fine with where name="listfiles"

This is very frustrating and I really would appreciate help, particularly if I'm going about this the wrong way. Is it even possible to use filenames supplied in the listbox to get a local file's input stream or does it have to be a file-input type.

Thanks a lot
15 years ago
Heya thanks a lot for the replies. I think this could be on the right lines, thanks.

How my page works is.. I'm uploading the file by getting its inputstream and passing that to a method elsewhere (which uploads the file to a database as a BLOB object). The form i'm using currently uses a 'get' rather than 'post' and the action is run on the same page, but I guess I'll have to change that. I've recently read I'll need to upload the file to the server first but instead of then writing it, I'll pass to the inputstream BLOB method.

So I'm guessing I'll have to 'post' each file individually from a file-input object, then I can get it as a File type using this? I'm fairly new to programming of this type so if anyone has any more sites or suggestions on how to do this, that'd be great! Thanks
15 years ago
I've been using Tomcat/local machine to produce some jsp pages for uploading files.

Files are selected and added to a listbox on a form, once the form is submitted - the filenames in the list are uploaded. Firstly there is a check to see if they exist. Something to the effect of..
for each file.

So typically in the listbox there will be C:\readme.txt or something to that effect. On local machine, this works perfectly - files are found and uploaded. However now, since I put this online to a server (which is an oracle server) when the form is submit -- the file can not be found. Initially when submit, the \'s would be removed.. (filenames which are not found are displayed in an error message) e.g C:\log.txt becomes C:log.txt so I added code to change this to unix separators.. C:\log.txt then becomes C:/log.txt ... still it cant find the file.

My experience with unix is fairly limited, is there a certain of writing a filename like that so that the jsp can pick it up? Or perhaps something I should look into to do with server itself? Any suggestions are appreciated. Thanks
15 years ago
Thanks a lots, thats a big help
15 years ago
Hi. I have a JSP page and I'm having trouble with some parameters... The page has a form containing a listbox, something like...

Files are browsed for with a <input type=file> object, when this is changed (onChange) the value is added to the listbox.

When the form is submitted with submit() -- all the selected options are then passed as parameters e.g. page.jsp?listnames=name+1&listnames=name+2

Here's the problem. Once submit I want to keep these values in the select box once its reloaded. So how I've done that is, for each 'listnames' paramater, an option is made when its reloaded

for each filelist parameter...

Once the page is submit again, the spaces have now been removed. Where once there was 'name 1' which appears as 'listnames=name+1' on the parameters, it is now just 'name' when re-submitted. There seems to be a problem with the spaces being recognised the second time round!! Does any one have any ideas how to resolve this?

Thanks alot
15 years ago