File tree Expand file tree Collapse file tree
java/com/amitshekhar/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11$ ( document ) . ready ( function ( ) {
22 getDBList ( ) ;
3+ $ ( "#query" ) . keypress ( function ( e ) {
4+ if ( e . which == 13 ) {
5+ queryFunction ( ) ;
6+ }
7+ } ) ;
38} ) ;
49
510function getData ( tableName ) {
@@ -17,7 +22,7 @@ function queryFunction() {
1722
1823 var query = $ ( '#query' ) . val ( ) ;
1924
20- $ . ajax ( { url : "query?query=" + query , success : function ( result ) {
25+ $ . ajax ( { url : "query?query=" + escape ( query ) , success : function ( result ) {
2126
2227 result = JSON . parse ( result ) ;
2328 inflateData ( result ) ;
Original file line number Diff line number Diff line change 4646import java .io .InputStream ;
4747import java .io .InputStreamReader ;
4848import java .io .PrintStream ;
49+ import java .io .UnsupportedEncodingException ;
4950import java .net .ServerSocket ;
5051import java .net .Socket ;
5152import java .net .SocketException ;
@@ -194,7 +195,11 @@ private void handle(Socket socket) throws IOException {
194195
195196 Response response ;
196197
197- query = java .net .URLDecoder .decode (query , "UTF-8" );
198+ try {
199+ query = java .net .URLDecoder .decode (query , "UTF-8" );
200+ } catch (Exception e ) {
201+ e .printStackTrace ();
202+ }
198203
199204 String first = query .split (" " )[0 ].toLowerCase ();
200205
You can’t perform that action at this time.
0 commit comments