javascript-How to solve this problem, please help me?

As shown in the picture, the page and page code are as shown in the picture, PHP+js. lt.com/img/bVcLdr Reply content: As shown in the picture, the page and page code are as shown in the picture, PHP+js. lt.com/img/bVcLdr

How to execute enumeration in java through reflection, please help me!

How to execute enumeration in java through reflection, please help me!

[size=16px]public class CommonConstants { /** *@desc Order type * @author tangkun * */ public enum ORDERTYPESTATE { HEADQUARTERSORDERS(“Headquarters Order”, 0), DEALERORDERS(“To be sold”, 1), DIRECTORDERS( “Direct Sales Order”, 2); private final String name; private final Integer value ; ORDERTYPESTATE(String name, Integer value) { this.name = name; this.value = value; } public String getName() { return name; } public Integer getValue() { return value; } } public static void main(String[] args) throws Exception { Class class1 = Class .forName(“com.tangkun.utils.CommonConstants$ORDERTYPESTATE”); Field[] field = class1.getFields(); for ( Field field2 : field) { field2.setAccessible(true); Class class2 = field.getClass();                                                                                                                                                                            Want to dynamically call the value of the variable in the enumeration */ Method[] methods = class2.getDeclaredMethods(); for (Method method : methods) { System.out.println(method.getName()); } } } } [/size] 11 solutions #1 public static void main(String[] args) throws Exception { Class class1 = Class .forName(“learning.CommonConstants$ORDERTYPESTATE”); ORDERTYPESTATE order = ORDERTYPESTATE.DEALERORDERS ; Method[] methods = class1.getDeclaredMethods(); for (Method method : methods) { if(method.getName().startsWith(“get”)){ System.out.println(method.getName() + “: ” + method.invoke(order)); } } } Is this what the poster wants? #2 sky_walker85: In my actual application scenario, I pass an “ORDERTYPESTATE” through a custom label to get the selection list to generate the drop-down box (select), so I cannot use…

How to convert php-PHP to Java, please help me

php protected function _postWithCOOKIE($uri, $data){ $fp = fsockopen(‘f.10086.cn’, 80); fputs($fp, “POST $uri HTTP/1.1\r\n”); fputs($fp, “Host: f.10086.cn\r\n”); fputs($fp, “COOKIE: {$this->_COOKIE}\r\n” ); fputs($fp, “Content-Type: application/x-www-form-urlencoded\r\n”); fputs($fp, “User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20100101 Firefox/14.0.1\r\n”); fputs($fp, “Content-Length: “.strlen($data).”\r\n”); fputs($fp, “Connection: close \r\n\r\n”); fputs($fp, $data); $result = ”; while (!feof($fp)) { $result .= fgets($fp); } fclose($ fp); return $result;} How to implement this code in Java

How to convert php-PHP to Java, please help me

php protected function _postWithCOOKIE($uri, $data){ $fp = fsockopen(‘f.10086.cn’, 80); fputs($fp, “POST $uri HTTP/1.1\r\n”); fputs($fp, “Host: f.10086.cn\r\n”); fputs($fp, “COOKIE: {$this->_COOKIE}\r\n” ); fputs($fp, “Content-Type: application/x-www-form-urlencoded\r\n”); fputs($fp, “User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20100101 Firefox/14.0.1\r\n”); fputs($fp, “Content-Length: “.strlen($data).”\r\n”); fputs($fp, “Connection: close \r\n\r\n”); fputs($fp, $data); $result = ”; while (!feof($fp)) { $result .= fgets($fp); } fclose($ fp); return $result;} How to implement this code in Java

javascript-How to solve this problem, please help me?

As shown in the picture, the page and page code are as shown in the picture, PHP+js. lt.com/img/bVcLdr Reply content: As shown in the picture, the page and page code are as shown in the picture, PHP+js. lt.com/img/bVcLdr

How to execute enumeration in java through reflection, please help me!

How to execute enumeration in java through reflection, please help me!

[size=16px]public class CommonConstants { /** *@desc Order type * @author tangkun * */ public enum ORDERTYPESTATE { HEADQUARTERSORDERS(“Headquarters Order”, 0), DEALERORDERS(“To be sold”, 1), DIRECTORDERS( “Direct Sales Order”, 2); private final String name; private final Integer value ; ORDERTYPESTATE(String name, Integer value) { this.name = name; this.value = value; } public String getName() { return name; } public Integer getValue() { return value; } } public static void main(String[] args) throws Exception { Class class1 = Class .forName(“com.tangkun.utils.CommonConstants$ORDERTYPESTATE”); Field[] field = class1.getFields(); for ( Field field2 : field) { field2.setAccessible(true); Class class2 = field.getClass();                                                                                                                                                                            Want to dynamically call the value of the variable in the enumeration */ Method[] methods = class2.getDeclaredMethods(); for (Method method : methods) { System.out.println(method.getName()); } } } } [/size] 11 solutions #1 public static void main(String[] args) throws Exception { Class class1 = Class .forName(“learning.CommonConstants$ORDERTYPESTATE”); ORDERTYPESTATE order = ORDERTYPESTATE.DEALERORDERS ; Method[] methods = class1.getDeclaredMethods(); for (Method method : methods) { if(method.getName().startsWith(“get”)){ System.out.println(method.getName() + “: ” + method.invoke(order)); } } } Is this what the poster wants? #2 sky_walker85: In my actual application scenario, I pass an “ORDERTYPESTATE” through a custom label to get the selection list to generate the drop-down box (select), so I cannot use…

How to get the value of java variable in js, friends, please help me

How to get the value of java variable in js, friends, please help me fun How to get the value of java variable in Javascript Explanation: In JSP; the Java part is executed on the server side; the js part is executed on the client’s browser; the two are completely unrelated. Therefore, it is not possible to call between js, java and HTML variables directly on the JSP page. Workaround (solution): Put the js variable into one of the forms; take the variable from the form in the background and put it into the hidden field; then submit the form to the page where the variable is to be called. This page can be itself. The example is as follows: bb.jsp page: aa.jsp page Java code: Note: If the same page passes a value to itself, aa.jsp and bb.jsp can be the same page. How to get variables in java in js JS and java are different languages ​​and run in different environments, so they cannot directly obtain each other’s data. Java runs on the server side. In the same jsp file, java runs first and js runs later. Java can generate a piece of js code to ensure that…

Daxiamen, please help me, how to add javascript?

Name: //Only alphanumeric characters are allowed in this part of the requirement alphanumberic characters 30 Charaters maximum Postal Address: //This part requires only alphabetical characters to be entered.   House or unit number:character onlymaxlength is equal to 10                Street Name:character only20 characters maximum                                                                                                                               Suburb:character only20 characters maximum             State:                            shipping Address:   House or unit number:            Street Name:                                                                                                                                 Suburb:             State:          Date that delivery is…

How to execute enumeration in java through reflection, please help me!

How to execute enumeration in java through reflection, please help me!

[size=16px]public class CommonConstants { /** *@desc Order type * @author tangkun * */ public enum ORDERTYPESTATE { HEADQUARTERSORDERS(“Headquarters Order”, 0), DEALERORDERS(“To be sold”, 1), DIRECTORDERS( “Direct Sales Order”, 2); private final String name; private final Integer value ; ORDERTYPESTATE(String name, Integer value) { this.name = name; this.value = value; } public String getName() { return name; } public Integer getValue() { return value; } } public static void main(String[] args) throws Exception { Class class1 = Class .forName(“com.tangkun.utils.CommonConstants$ORDERTYPESTATE”); Field[] field = class1.getFields(); for ( Field field2 : field) { field2.setAccessible(true); Class class2 = field.getClass();                                                                                                                                                                            Want to dynamically call the value of the variable in the enumeration */ Method[] methods = class2.getDeclaredMethods(); for (Method method : methods) { System.out.println(method.getName()); } } } } [/size] 11 solutions #1 public static void main(String[] args) throws Exception { Class class1 = Class .forName(“learning.CommonConstants$ORDERTYPESTATE”); ORDERTYPESTATE order = ORDERTYPESTATE.DEALERORDERS ; Method[] methods = class1.getDeclaredMethods(); for (Method method : methods) { if(method.getName().startsWith(“get”)){ System.out.println(method.getName() + “: ” + method.invoke(order)); } } } Is this what the poster wants? #2 sky_walker85: In my actual application scenario, I pass an “ORDERTYPESTATE” through a custom label to get the selection list to generate the drop-down box (select), so I cannot use…

Please help me, I want to learn Java2 in 5 days

The leader of our project team forced me to learn Java2 within 5 days, but I didn’t understand Java at all before. Now one day has passed and I haven’t learned anything at all. I can’t even use the honey trap on the team leader. Please help me. I’d like some ideas. I’m very familiar with C++ and I heard it would be helpful for learning Java. Please also recommend me a book for beginners to learn Java2 and give me some ideas, otherwise I will be beaten by the team leader next week. (He thinks being handsome is great, and he doesn’t even give face to a beautiful woman like me. I feel dizzy) 305 solutions #1 If you are familiar with C++, you don’t need to learn the Java language at all (but you still have to look at it). You can just learn the application directly. #2 If you learn c++ well. Just pick up a book and read it. Just know how to make it up. But the fastest way is to watch the video. You can read it in one day. #3 Take a look at the difference in syntax and apply it directly. Have…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索