Username and password
Posted: Wed May 19, 2010 6:10 pm
I’m evaluate your applet_http_ipreview running on ”IBM Rational Developer for i” (a WebSphere Application Server running on localhost) v.7.5 for my client.
The upload destination is a System i (via local VPN), i.p. address: 192.168.201.4
When test it on my PC, if I sign on with username and password via Windows (map network drive), with no problem to upload the files.
The problem is that, I like to embed the user name and password in the Java Script.
Here is the code of applet_http_ipreview.js
....
//initial setup. 5/13/10 - JChen
//document.write('url="http://localhost:8080/upload/process.jsp" ');
document.write('url="http://localhost:9082/fileUpload/process.jsp" ');
document.write('hidebar="false" ');
document.write('paramfile="uploadfile" ');
document.write('param1="todo" ');
document.write('value1="upload" ');
//***************************************************************
document.write('parm2="username" ');
document.write('value2="reward1\userabc" ');
document.write('parm3="password" ');
document.write('value3="XXXXXXXX" ');
//***************************************************************
document.write('transferui="jfileupload.transfer.client.preview.PreviewerTransferUI" ');
document.write('resources="i18n_bar" ');
document.write('transferuiresources="i18n_pane" ');
document.write('mode="http" ');
document.write('scriptable=true ');
document.writeln('pluginspage="http://java.sun.com/products/plugin/ind ... "><NOEMBED>');
// END
}
else {
document.writeln('<APPLET CODE="jfileupload.upload.client.MApplet.class" JAVA_CODEBASE="./" ARCHIVE="lib/jfileupload.jar,lib/httpimpl.jar,lib/chttpclient.jar,lib/clogging.jar,lib/previewui.jar" WIDTH="640" HEIGHT="350" NAME="fileupload">');
}
// BEGIN: Update parameters below for INTERNET EXPLORER, FIREFOX, SAFARI, OPERA, MOZILLA, NETSCAPE 6+ support.
document.writeln('<PARAM NAME=CODE VALUE="jfileupload.upload.client.MApplet.class">');
document.writeln('<PARAM NAME=CODEBASE VALUE="./">');
document.writeln('<PARAM NAME=ARCHIVE VALUE="lib/jfileupload.jar,lib/httpimpl.jar,lib/chttpclient.jar,lib/clogging.jar,lib/previewui.jar">');
document.writeln('<PARAM NAME=NAME VALUE="fileupload">');
document.writeln('<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">');
document.writeln('<PARAM NAME="scriptable" VALUE="true">');
//initial setup. 5/13/10 - JChen
//document.writeln('<PARAM NAME="url" VALUE="http://localhost:8080/upload/process.jsp">');
document.writeln('<PARAM NAME="url" VALUE="http://localhost:9082/fileUpload/process.jsp">');
document.writeln('<PARAM NAME="hidebar" VALUE="false">');
document.writeln('<PARAM NAME="paramfile" VALUE="uploadfile">');
document.writeln('<PARAM NAME="param1" VALUE="todo">');
document.writeln('<PARAM NAME="value1" VALUE="upload">');
//***************************************************************************************
document.writeln('<PARAM NAME="param2" VALUE="username">');
document.writeln('<PARAM NAME="value2" VALUE="reward1\userabc">');
document.writeln('<PARAM NAME="param3" VALUE="password">');
document.writeln('<PARAM NAME="value3" VALUE="XXXXXXXX">');
//****************************************************************************************
...
When running I have the error 500:
Upload failed: server error HTTP/1.1 500 com.ibm.ws.jsp.jspCoreException:java.lang.reflect.InvocationTargetException...
Please advice.
Thnaks,
Jiunn Chen
The upload destination is a System i (via local VPN), i.p. address: 192.168.201.4
When test it on my PC, if I sign on with username and password via Windows (map network drive), with no problem to upload the files.
The problem is that, I like to embed the user name and password in the Java Script.
Here is the code of applet_http_ipreview.js
....
//initial setup. 5/13/10 - JChen
//document.write('url="http://localhost:8080/upload/process.jsp" ');
document.write('url="http://localhost:9082/fileUpload/process.jsp" ');
document.write('hidebar="false" ');
document.write('paramfile="uploadfile" ');
document.write('param1="todo" ');
document.write('value1="upload" ');
//***************************************************************
document.write('parm2="username" ');
document.write('value2="reward1\userabc" ');
document.write('parm3="password" ');
document.write('value3="XXXXXXXX" ');
//***************************************************************
document.write('transferui="jfileupload.transfer.client.preview.PreviewerTransferUI" ');
document.write('resources="i18n_bar" ');
document.write('transferuiresources="i18n_pane" ');
document.write('mode="http" ');
document.write('scriptable=true ');
document.writeln('pluginspage="http://java.sun.com/products/plugin/ind ... "><NOEMBED>');
// END
}
else {
document.writeln('<APPLET CODE="jfileupload.upload.client.MApplet.class" JAVA_CODEBASE="./" ARCHIVE="lib/jfileupload.jar,lib/httpimpl.jar,lib/chttpclient.jar,lib/clogging.jar,lib/previewui.jar" WIDTH="640" HEIGHT="350" NAME="fileupload">');
}
// BEGIN: Update parameters below for INTERNET EXPLORER, FIREFOX, SAFARI, OPERA, MOZILLA, NETSCAPE 6+ support.
document.writeln('<PARAM NAME=CODE VALUE="jfileupload.upload.client.MApplet.class">');
document.writeln('<PARAM NAME=CODEBASE VALUE="./">');
document.writeln('<PARAM NAME=ARCHIVE VALUE="lib/jfileupload.jar,lib/httpimpl.jar,lib/chttpclient.jar,lib/clogging.jar,lib/previewui.jar">');
document.writeln('<PARAM NAME=NAME VALUE="fileupload">');
document.writeln('<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">');
document.writeln('<PARAM NAME="scriptable" VALUE="true">');
//initial setup. 5/13/10 - JChen
//document.writeln('<PARAM NAME="url" VALUE="http://localhost:8080/upload/process.jsp">');
document.writeln('<PARAM NAME="url" VALUE="http://localhost:9082/fileUpload/process.jsp">');
document.writeln('<PARAM NAME="hidebar" VALUE="false">');
document.writeln('<PARAM NAME="paramfile" VALUE="uploadfile">');
document.writeln('<PARAM NAME="param1" VALUE="todo">');
document.writeln('<PARAM NAME="value1" VALUE="upload">');
//***************************************************************************************
document.writeln('<PARAM NAME="param2" VALUE="username">');
document.writeln('<PARAM NAME="value2" VALUE="reward1\userabc">');
document.writeln('<PARAM NAME="param3" VALUE="password">');
document.writeln('<PARAM NAME="value3" VALUE="XXXXXXXX">');
//****************************************************************************************
...
When running I have the error 500:
Upload failed: server error HTTP/1.1 500 com.ibm.ws.jsp.jspCoreException:java.lang.reflect.InvocationTargetException...
Please advice.
Thnaks,
Jiunn Chen