Recent Posts
-
What kind of programming language is Java?
Java is a simple, object-oriented, interpretive, robust, safe, naturally structured, portable, high-performance, multi…… -
Java InetAddress class and its common methods
Example 1 public static void main(String[] args) { try { InetAddress ia1=InetAddress.getB…… -
JSP Request. Getrequesturl () method: get the absolute path of the client accessing the website
getRequestURI() Example <% StringBuffer p = request.getRequestURL(); out.println("访问的URL路径为:"+p); %&…… -
Java tochararray() method: converts a string into a character array
tocharArray() Example public static void main(String[] args){ String strCom = "JAVA编程词典"; //定义字符串 …… -
Java trim() method: remove the spaces before and after the string
trim() Example public static void main(String[] args){ String strCom = "JAVA编程词典"; //定义字符串 Strin…… -
Java Set. Remove() method: removes the specified object from the set collection
remove(Object o) Typical application public static void main(String[] args){ Set set = new HashSet(); //定义Se…… -
JSP Request. Getauthtype () method: returns the authentication scheme name of the protection servlet
getAuthType() Example <% out.print(request.getAuthType()); %> -
JSP config. The getinitparameter () method gets the value of the initial parameter
getInitParameter(String name) Example <% String name = config.getInitParameter("fork"); out.println("parame…… -
Basic knowledge of Java network programming
Network classification Network programming model Client / Server Mode Browser / Server Mode Network protocol IP protoc…… -
JSP Request. Getheadersnames() method: returns the names of all request headers
getHeaderNames() Example <% Enumeration cts = request.getHeaderNames(); while(cts.hasMoreElements()){ …… -
Jsp: fallback: prompt tag
…… < Jsp: fallback > error message < / JSP: fallback >... < / JSP: plugin > is set here Exam…… -
Java Connection. Rollback() method: transaction rollback
Grammar 1 rollback() Example Connection conn = …… //省略部分代码 conn.setAutoCommit(false); //先将事务设为手动提…… -
Java Map. Putall() method: append another map object to the current map collection
putAll(Mapm) Typical application public static void main(String[] args){ Map map1 = new HashMap(); //定义Map集…… -
JSP application. Getrealpath() method: get the real path of the virtual path
getRealPath(String path) Example <% String path=application.getRealPath("index.jsp"); out.println(path); %…… -
JSP PageContext. Getsession () method: returns the current session object
getSession() Example <% HttpSession s = pageContext.getSession(); s.setAttribute("user","C语言中文网"); %&…… -
Java Statement. Addbath() method: add batch statement
addBatch(String sql) Typical application public void bathInsert(){ Connection conn=getCon(); //省略部分代码 …… -
JSP config. Getinitparameternames() method: get the names of all initial parameters
getInitParameterNames() Example <% Enumeration names = config.getInitParameterNames(); while(names.hasMoreE…… -
Java DriverManager. Getdriver () method: select an appropriate driver
getDriver(String url) Example Class.forName("com.MysqL.jdbc.Driver"); //注册MysqL驱动 String url = "jdbc:MysqL://l…… -
JSP PageContext. Getpage () method: returns the current page object
getPage() Example <% page = pageContext.getPage(); %> -
Java DriverManager. Getconnection() method: get database connection
Grammar 1 getConnection(String url) Example public Connection getConnection(){ Connection con=null; try{ …… -
Java pause / suspend thread (suspend()) and resume thread (resume())
Suspend() and resume() methods package ch14; public class MyThread21 extends Thread { private long i=0; …… -
JSP PageContext. Include () method: include the file in the page
Grammar 1 include(String relativeUrlPath) Example <%@page language="java" pageEncoding="GBK"%> <% …… -
JSP Request. Getcharacterencoding() method: returns the character encoding format
getCharacterEncoding() Example <% String encoding = request.getCharacterEncoding(); out.println("请求页面的…… -
Java lastindexof() method: returns the index position of the last occurrence
Grammar 1 lastIndexOf(int ch) Example String strCom = "abcdefg gfdecba"; int index = strCom.lastIndexOf("a"); Gramm…… -
The role of the Java getid () method
package ch14; public class Test15 { public static void main(String[] args) { Thread runThread=T…… -
JSP application. Getresourcepaths() method: returns all files in the specified directory
getResourcePaths(String path) Example <% Set set = application.getResourcePaths("/"); //返回装载指定路径列表…… -
JSP config. Getservletname() method: get the name of the servlet
getServletName() Example <% String name = config.getServletName(); out.println("Servlet name is:"+name); %…… -
Java Map. Containsvalue() method: judge whether the map collection contains the specified key value
containsValue(Object value) Example public static void main(String[] args){ Map map = new HashMap(); //定义Map…… -
Java List. Addall() method: adds all elements to the list
Grammar 1 addAll(Collectionc) Example public static void main(String[] args){ List<String>list = new Arra…… -
Java substring() method: evaluate substring (intercept string)
Grammar 1 substring(int beginIndex) Example String strCom = "I Like Java"; String strResult = strCom.substring(3); …… -
JSP PageContext. GetException () method: get the current exception object
getException() Example <%@page language="java" errorPage="error.jsp" pageEncoding="GBK"%> <% Integ…… -
Priority and execution order of Java threads
Priority overview public final void setPriority(int newPriority); public final int getPriority(); Use priority Exa……