Friday, March 7, 2014

I'm going crazy, simply can not solve the problem, seeking Great God


android code
 private class ClickListener implements View.OnClickListener {
@ Override
public void onClick (View v) {
useridedit = (EditText) findViewById (R.id.userid);
passedit = (EditText) findViewById (R.id.pass);
String userid = useridedit.getText () toString ();.
String pass = passedit.getText () toString ();.
String urlstr = "http://172.18.112.151:8080/chatserver/CheckLogin?userid =" + userid + "& pass =" + pass;
try {
URL url = new URL (urlstr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection ();
Log.i ("v", urlstr);
. Toast.makeText (getApplicationContext (), userid + "", 1) show ();
} Catch (MalformedURLException e) {
e.printStackTrace ();
} Catch (IOException e) {
e.printStackTrace ();
}
/ * If (! Userid.equals ") (" "() &&! Pass.equals") {
if (v.getId () == login.getId ()) {
if (new CheckLogin (). check (userid, pass)) {

} Else {
Toast.makeText (getApplicationContext (), R.string.loginerror, Toast.LENGTH_SHORT) show ();.
}
} Else if (v.getId () == cancel.getId ()) {
MainActivity.this.finish ();
}
} Else {
Toast.makeText (getApplicationContext (), R.string.loginvalid, Toast.LENGTH_SHORT) show ();.
} * /
}

servlet code:
 public void doPost (HttpServletRequest request, HttpServletResponse response) 
throws ServletException, IOException {
System.out.println ("init");
String userid = request.getParameter ("userid");
String pass = request.getParameter ("pass");
System.out.println (userid + "" + pass);
}

Question: Well my servlet inside System.out.println (userid + "" + pass); nothing Oil Print<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
1 network permissions have not?
2.

HttpURLConnection conn = (HttpURLConnection) url.openConnection ();
conn.connect () ;/ / did not see this.
Reply:
System.out.println ("init");?? This is not also print not
I think you use System.out.println how useless ah ...
Previously been printed with log4j
Reply:
reference to the second floor guoyoulei520 reply:
System.out.println ("init"); This is not also print not
??I think you use System.out.println how useless ah ...
Previously been printed with log4j
对, init did not oil
Reply:
reference to the third floor aaaabbbccd9876 reply:
Quote: references to the second floor guoyoulei520 reply:

System.out.println ("init");?? This is not also print not
I think you use System.out.println how useless ah ...
Previously been printed with log4j
对, init did oil

WEB end, then print it using log4j
Reply:
cited a floor birdsaction reply:.
1 network permissions have not?
2.

HttpURLConnection conn = (HttpURLConnection) url.openConnection ();
conn.connect () ;/ / did not see this.
I have tried, useless
Reply:
http://172.18.112.151:8080/chatserver/CheckLogin
Try inside the browser, whether it is capable of.
Reply:
I'm here with a few days ago, null values, and get less, changing the way
At the beginning:
String uploadUrl = "http://" + ip + ": 8080/uploadfileservlet/UploadServlet";
result = new FileUploadUtil () uploadFile (picPath, uploadurl);.

Thus there is a problem with the above,
Replaced so the
result = new FileUploadUtil (). uploadFile (picPath, "http://" + ip
+ ": 8080/uploadfileservlet/UploadServlet");
Well then, I was put out of Yilengyileng. I do not know why, you see something next to you, is not nearly so

Reply:
Problem solved yet
Access points,
Reply:
references, 4th Floor guoyoulei520 reply:
Quote: references to the third floor aaaabbbccd9876 reply:

Quote: references to the second floor guoyoulei520 reply:

System.out.println ("init");?? This is not also print not
I think you use System.out.println how useless ah ...
Previously been printed with log4j
对, init did oil

WEB end, then print it using log4j
syso can also print
Reply:
reference to the 6th floor birdsaction reply:
http://172.18.112.151:8080/chatserver/CheckLogin
Try inside the browser, whether it is capable of.
is pass
Reply:
reference to the 8th floor u010493200 reply:
solved the problem yet
Access points,
can be solved in another way, but this approach still do not know why this result
Reply:
This method is that you do not have to perform, with a single-step method to try to call it?
Reply:
try {
URL url = new URL (urlstr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection ();
conn.connect ();
Log.i ("v", urlstr);
. Toast.makeText (getApplicationContext (), userid + "", 1) show ();
} Catch (MalformedURLException e) {
e.printStackTrace ();
} Catch (IOException e) {
e.printStackTrace ();
}

Abnormal printed in the background it?

No comments:

Post a Comment