Navya J Nair

Greenhorn
+ Follow
since Apr 04, 2012
Merit badge: grant badges
For More
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 Navya J Nair

Thanks Eric for the reply,

My problem is to have empty 3*3 table cells.
A user has to click a cell only once and either X or 0 has to be written inside the cell. Then that cell index/id should be sent to the servlet for further processing
Sorry for being vague.
I need a help in writing javascript function and making use of ajax in order to send a index of table cell when it is clicked to the servlet and should remain in same page
Hi folks,

I am new to JSP/Servlet.Please help!!
I need to send the table cell index in servlet using javascript and should be able to make a cell index to have a text - "X" / "0"only once.


This is Tictactoe game-
my concern is when user clicks/make move on button it should write a content and it needs to be saved in database and then it has to again fetched back from db when 2nd player is ready for placing his mark/move on other button it

hope you got it
I am looking but its quite complicated as we need to find only one onclick event at a time of 1 player.
Thanks for all the replies.
Actually I have a ques regarding the table cell.Can we make use of only table <td> and have onclick event on that. or should have to use any input type like button.
And at a time we need to make use of 1 click on 1 button .So how can we make fetch the cell events in javascript
Hi All,

I am building a TicTacToe game web-services application using jsp and servlet where I need to extract the table's cell onclick event each time for each user and pass is to servlet using javascript

The code so far I have built is :


Sorry about that.Yes I need to fetch using javascript of table cell's click at a single time for one player.Please help.I am stuck up with this.
Hi All,

Please help !!!

I am building a TicTacToe game web-services application using jsp and servlet where I need to extract the table's cell onclick event each time for each user and pass is to servlet.

The code so far I have built is :

</script>
<style type="text/css">
body{
text-align: center;
}
table{
text-align: center;
table-layout:fixed;
}
</style>
</head>

<body>
<form action="TicTacToeGame" method="post">

<table id="board" border=1 align=left cellpadding="2" cellspacing="3" width="250" height="250" >
<tr>
<td> <input type="button" name="11" /> </td>
<td> <input type="button" name="12" /> </td>
<td> <input type="button" name="13" /> </td>
</tr>
<tr>
<td> <input type="button" name="21" /> </td>
<td> <input type="button" name="22" /> </td>
<td> <input type="button" name="23" /> </td>
</tr>
<tr>
<td> <input type="button" name="31" /> </td>
<td> <input type="button" name="32" /> </td>
<td> <input type="button" name="33" /> </td>
</table>
<div>
<input type="submit" name="submit" value="MyMove">
</div>

</form>
</body>

</html>
Hi All,

Please help !!!

I am building a TicTacToe game web-services application using jsp and servlet where I need to extract the table's cell onclick event each time for each user and pass is to servlet.

The code so far I have built is :

</script>
<style type="text/css">
body{
text-align: center;
}
table{
text-align: center;
table-layout:fixed;
}
</style>
</head>

<body>
<form action="TicTacToeGame" method="post">

<table id="board" border=1 align=left cellpadding="2" cellspacing="3" width="250" height="250" >
<tr>
<td> <input type="button" name="11" /> </td>
<td> <input type="button" name="12" /> </td>
<td> <input type="button" name="13" /> </td>
</tr>
<tr>
<td> <input type="button" name="21" /> </td>
<td> <input type="button" name="22" /> </td>
<td> <input type="button" name="23" /> </td>
</tr>
<tr>
<td> <input type="button" name="31" /> </td>
<td> <input type="button" name="32" /> </td>
<td> <input type="button" name="33" /> </td>
</table>
<div>
<input type="submit" name="submit" value="MyMove">
</div>

</form>
</body>

</html>
11 years ago
JSP
Okie
So , 1st I need to build the 3*3 grid using html (probably using table) i.e in jsp which is client side and then start coding each function like makeMove(), getWinner() in web-service part .
Please correct me if I am wrong.

Thanks Tim and would please suggest a good tutorial on web-services


11 years ago
I need to implement the jsp in the client side which is user friendly i.e it need to have 3*3 button for 2 users/players .My concern is how to integrate the jsp buttons or any fields to the code i have implemented in webservice(as i have posted)

I am a new bee..please help !!!
11 years ago
Hi Tim,

I am able to draw a 3*3 grid using:
public String drawBoard() {
StringBuilder builder = new StringBuilder("Game board: \n");
for (int i = 0; i < 3; i++) {
for (int i1 = 0; i1 < 3; i1++) {
builder.append("[" + board[i][i1] + "]");
}
builder.append("\n");
}
return builder.toString();
}
public void init() {
int counter = 1;
for (int i = 0; i < 3; i++) {
for (int i1 = 0; i1 < 3; i1++) {
board[i][i1] = counter++;

}
}

and able to get the 3*3 grid with 1-9 numbers in the console as follows:
[1][2][3]
[4][5][6]
[7][8][9]

My concern is how to integrate jsp UI fields to this 3*3 grid.

11 years ago
Hi folks,

Could anyone please let me know how to built the web-service for TicTacToe game (3*3grid) for multiple user sessions and client has to built using jsp

If anyone has come up with the code,please do post it.

Your reply will be highly appreciable

Regards,
Navya
11 years ago