Mo Alexwainy

Greenhorn
+ Follow
since Apr 15, 2017
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 Mo Alexwainy

Dear All,
i have two questions:
1. i want to disable any user to navigate through the application while specifying a URI.
   for example my app is http://myapp, now i need to restrict any user to navigate to any URI under the application manually such as http://myapp/print

2. i am installing the application on a server that is accessible by other people, i need to hide my classes on the server from being read/altered. is there any method?

Thanks!
1 month ago
Can you point me to an example?
the device is connected to the LAN.
there is an SDK zkemkeeper that is being used however it is written in VB.
i need to connect and retrieve the date in java to store them in my database and write my own HR application.
1 year ago
This is actually what i am missing, how would i know if the socket is sending data?
1 year ago
Nothing is print after adding a print line.
the code is still trapped in the loop....
1 year ago
I have added a print instruction after the try and it echoed it.
but it seems that the code isn't entering the loop, no output is being displayed.




Output:

Socket status : true
Good Morning
1 year ago
Nothing is returned. I am only able to connect but further to that nothing is returned to the line?
1 year ago
I have used the below.
I am able to connect to the device but no data has been output on the command line.

try {
Socket socket = new Socket(host, port);
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));

String line;
while (true){
line = in.readLine();
if (line != null){
System.out.println(line);
}
}
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
1 year ago
Hi,
Would someone assist on providing an example for retrieving biometric attendance data?

I have used the socket example but the console never returned any data.

Thanks

1 year ago

Mo Alexwainy wrote:

Bear Bibeault wrote:Pay attention to what Paul posted. The JavaScript code does not -- I repeat does not -- execute in line with the Java code. It is run much later in the browser on the user's machine.

Please read this article -- even though it talks about JSP (why aren't you using JSP?) the same is true for HTML code emitted by a servlet.



Thanks. But why does the alert within this js runs at the same time the loop is executed?
Doesnt this mean that the js runs every time the loop circulates?

Also, the below js runs anytime in my servlet whenever i execute it. It does not run at anytime later on.

out.println("<script type=\"text/javascript\">");
out.println("document.getElementById('myBody').innerHTML = '';");
out.flush();

Bear Bibeault wrote:Pay attention to what Paul posted. The JavaScript code does not -- I repeat does not -- execute in line with the Java code. It is run much later in the browser on the user's machine.

Please read this article -- even though it talks about JSP (why aren't you using JSP?) the same is true for HTML code emitted by a servlet.



Thanks. But why does the alert within this js runs at the same time the loop is executed?
Doesnt this mean that the js runs every time the loop circulates?

Ron McLeod wrote:

Mo Alexwainy wrote:This is a snipet from my servlet.

There is a loop that generates a percentage value.


The code that you have posted will generate something that looks like this:



Here right before the snipet

While(rs.next()){

percentage=cnt/couter*100;


}

Paul Clapham wrote:You're asking a question about JavaScript, but the code you posted is Java code. It does generate JavaScript code, but now it's unclear whether you're asking about the generated Javascript or the posted Java.

And saying "the code runs in a loop" just adds to the confusion. Is it the Java code or the JavaScript code which runs in a loop?

And asking about the JavaScript which is "right after this textbox" is confusing too. What does "right after" even mean?

I'd suggest you start again. Try to clarify whether you are asking about the act of generating the JavaScript code, or whether you are asking about something which happens when you run that code.



This is a snipet from my servlet.

There is a loop that generates a percentage value.

LOOP STARTS

The input textbox stores the percentage value.

This is done successfully.

Right after the text box, i have called a js where it gets the percentage value from the textbox.

LOOP ENDS.

The var in the js is not able to get the updated value of the textbox. However it sticks to the initial value that the textbox had in the first loop entry.

Meaning that in the first loop entry, the percentage is 1.
The textbox sets the value correctly so does the var in the js.
In loop entry 2 till end, the textbox updates the value correctly 2,3... but the var in the js sticks to value 1
hi,
in my servlet i have introduced a text box that takes the value dynamically from a variable.
this has no issues and the text box is being updated.

however the javascript right after this textbox sticks to the first value that has been assigned to the text box.

the code runs in a loop, thus each time the percentage value is being updated.

any thoughts?



hi,
I need to check if user already exists in db using servlet whenever the user changes the input (onChange).
i need to perform this without going to another page or submitting a form button as i need an alert message or display message showing (user already exists).
2 years ago
The html and js are working.
Would you please advise what would be the best practice to call a confirmation dialogue before executing the delete servlet noting that i need to pass a radio button value to the delete servlet?