Alex Hank

Greenhorn
+ Follow
since Apr 27, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alex Hank

thanks for the advice.

I figured it out by creating the method charFix.

<%!
String replace(String s, String one, String another) {
// In a string replace one substring with another
if (s.equals("")) return "";
String res = "";
int i = s.indexOf(one,0);
int lastpos = 0;
while (i != -1) {
res += s.substring(lastpos,i) + another;
lastpos = i + one.length();
i = s.indexOf(one,lastpos);
}
res += s.substring(lastpos); // the rest
return res;
}

String charFix(String s){
//REPLACE ALL NONENGLISH CHARACTERS WITH ENGLISH CHARACTERS
if (s.equals("")) return "";
String res = s;
String badChar = "";

badChar = new Character((char)013).toString();res = replace(res,badChar, "");
badChar = new Character((char)034).toString();res = replace(res,badChar, ""); //"
badChar = new Character((char)000).toString();res = replace(res,badChar, ""); //BLANK

badChar = new Character((char)192).toString();res = replace(res,badChar, "A");
badChar = new Character((char)193).toString();res = replace(res,badChar, "A");
badChar = new Character((char)194).toString();res = replace(res,badChar, "A");
badChar = new Character((char)195).toString();res = replace(res,badChar, "A");
badChar = new Character((char)196).toString();res = replace(res,badChar, "A");
badChar = new Character((char)197).toString();res = replace(res,badChar, "A");
badChar = new Character((char)198).toString();res = replace(res,badChar, "A");

badChar = new Character((char)200).toString();res = replace(res,badChar, "E");
badChar = new Character((char)201).toString();res = replace(res,badChar, "E");
badChar = new Character((char)202).toString();res = replace(res,badChar, "E");
badChar = new Character((char)203).toString();res = replace(res,badChar, "E");

badChar = new Character((char)204).toString();res = replace(res,badChar, "I");
badChar = new Character((char)205).toString();res = replace(res,badChar, "I");
badChar = new Character((char)206).toString();res = replace(res,badChar, "I");
badChar = new Character((char)207).toString();res = replace(res,badChar, "I");

badChar = new Character((char)210).toString();res = replace(res,badChar, "O");
badChar = new Character((char)211).toString();res = replace(res,badChar, "O");
badChar = new Character((char)212).toString();res = replace(res,badChar, "O");
badChar = new Character((char)213).toString();res = replace(res,badChar, "O");
badChar = new Character((char)214).toString();res = replace(res,badChar, "O");

badChar = new Character((char)217).toString();res = replace(res,badChar, "O");
badChar = new Character((char)218).toString();res = replace(res,badChar, "O");
badChar = new Character((char)219).toString();res = replace(res,badChar, "O");
badChar = new Character((char)220).toString();res = replace(res,badChar, "O");

badChar = new Character((char)224).toString();res = replace(res,badChar, "a");
badChar = new Character((char)225).toString();res = replace(res,badChar, "a");
badChar = new Character((char)226).toString();res = replace(res,badChar, "a");
badChar = new Character((char)227).toString();res = replace(res,badChar, "a");
badChar = new Character((char)228).toString();res = replace(res,badChar, "a");
badChar = new Character((char)229).toString();res = replace(res,badChar, "a");
badChar = new Character((char)230).toString();res = replace(res,badChar, "a");

badChar = new Character((char)232).toString();res = replace(res,badChar, "e");
badChar = new Character((char)233).toString();res = replace(res,badChar, "e");
badChar = new Character((char)234).toString();res = replace(res,badChar, "e");
badChar = new Character((char)235).toString();res = replace(res,badChar, "e");

badChar = new Character((char)236).toString();res = replace(res,badChar, "i");
badChar = new Character((char)237).toString();res = replace(res,badChar, "i");
badChar = new Character((char)238).toString();res = replace(res,badChar, "i");
badChar = new Character((char)239).toString();res = replace(res,badChar, "i");

badChar = new Character((char)241).toString();res = replace(res,badChar, "n");

badChar = new Character((char)242).toString();res = replace(res,badChar, "o");
badChar = new Character((char)243).toString();res = replace(res,badChar, "o");
badChar = new Character((char)244).toString();res = replace(res,badChar, "o");
badChar = new Character((char)245).toString();res = replace(res,badChar, "o");
badChar = new Character((char)246).toString();res = replace(res,badChar, "o");

badChar = new Character((char)248).toString();res = replace(res,badChar, "u");
badChar = new Character((char)249).toString();res = replace(res,badChar, "u");
badChar = new Character((char)250).toString();res = replace(res,badChar, "u");

return res;
}
%>
15 years ago
JSP
our database guy (my boss) says that when he moves the data between a linux and windows machine, the records with non english character sets can cause trouble. It will stop transfering the data at the record with the non english characters.

Our database guy has a method to do the conversion in the database, however, I guess that he rather not have to do it. We use a Red Back database(I wish we used mysql)

Our database guy also says that in the past, we have also had problem printing badges that have nonenglish characters.

I am just following bosses orders.

So this should be done on the client side with javascript before submit?

Is there a method to do it with JSP?

thanks

alex
15 years ago
JSP
The site that I work on uses several forms to collect various information. Sometimes when users use non english character sets, it can cause trouble with our systems.

How can I force users to use the english character set, or how do I convert it to the english character set before it put it in the database.

I am not sure if this is done on the client side or the server side.

can someone please shed some light on this


thanks

Alex
15 years ago
JSP
The site that I work on uses several forms to collect various information. Sometimes when users use non english character sets, it can cause trouble with our systems.

How can I force users to use the english character set, or how do I convert it to the english character set before it put it in the database.

I am mainly using jsp pages. I am not sure if this is done on the client side or the server side.


thanks

Alex
Thanks for the reply.

The JSP file browser is a very helpful jsp page that allows remote: file upload, download, edit, delete, ect.

The page has been extremely helpful to me. I recomend checking it out. Its also free!

http://www.vonloesch.de/jspbrowser.html
15 years ago
JSP
I have a web site running HTTPS.

I am using the JSP file brower to list many of my personal files. When a user clicks on the file name hyperlink, the open/save prompt appears.

My Question: If the user chooses to open or save, will this transfer of the file be encripted? I believe that it will, I just want to make sure.

thanks,

Alex
[ June 27, 2005: Message edited by: Bear Bibeault ]
15 years ago
JSP
I have a web site running HTTPS.

I am using the JSP file brower to list many of my personal files. When a user clicks on the file name hyperlink, the open/save prompt appears.

My Question: If the user chooses to open or save, will this transfer of the file be encripted? I believe that it will, I just want to make sure.

thanks,

Alex
15 years ago
I have some simple code that blows up if the string array is empty. I need an if statement that will not execute the code if the array is empty.


int numDir = 0;

String [] selfiles = request.getParameterValues("selfile");

for(int i = 0; i < selfiles.length; i++){ if(selfiles[i].indexOf(".") == -1 ){numDir++;} }//ELEMENTS WITHOUT "." ARE NOT FOLDERS


I need an if statement that will not run the for loop if the array selfiles is empty.

thanks

Alex
15 years ago
I am able to use this login to access the table "dial" through PHPMyAdmin.

I manage my accounts with PHPMyAdmin, and MySQL Administrator.

thanks
my redhat server runs mysql and resin

I have been able to connect my jsp pages to MYSQL with root login and passwork. I created another mysql account (mrdata) to with less priviledges for security reasons.

Now with the new user account mrdata I can not connect to the data base with JSP.

I get the error:

Client does not support authentication protocol requested by server; consider upgrading MySQL client (this does not make sense to me because I was getting the same error when I would try to login to phpmyadmin admin with this login. Then I changed the password to the old password format, and I was able to get into Phpmyadmin, however, I still could not get this login to connect the JSP.)


With the jsp code, I only needed the username and password changed. right? Here is the code:

<%@ page language="java" import="java.sql.*" %>
<%
String db = "dial";

String url="jdbc:mysql-caucho://localhost:3306/" + db;

Class.forName("com.caucho.jdbc.mysql.Driver");

Connection myConn = DriverManager.getConnection(url,"mrdata","rinkerton");
%>

Alex
thanks for the info
15 years ago
JSP
I can get the ip address of the user with request.getRemoteAddr().

Is it possible to get the MAC address of the user?

Alex

[Edited to try and avoid confusion between the terms MAC (as Media Access Control) and Mac (as short for Macintosh)]
[ June 15, 2005: Message edited by: Bear Bibeault ]
15 years ago
JSP
thank you
15 years ago
JSP
The following string is a directory to a mp3. How do I convert this to normal text in jsp?

%2Fmedia%2Fmyfiles%2FWillie+Nelson%2FGreatest+Hits+%28%26+Some+That+Will+Be%29%2FIf+You%27ve+Got+the+Money+%28I%27ve+Got+the+Time%29.mp3

thanks

Alex
15 years ago
JSP
I want a case sensitive sql statement to control the logins to my website.

I currently use the following statement, however, it does not match case.

SELECT userid,username,firstname, lastname, email, usertype, securelevel, upload, download FROM useraccount WHERE username='"+request.getParameter("id")+"' and password='"+request.getParameter("password")+"'"

Alex