包含标签:Java 的文章
-
JSP application. Getmimitype() method: returns the MIME type of the specified file
getMimeType(String file) Example <% out.print(application.getMimeType("photo.jpg")); %> 运行结果如下: i…… -
Jsp: getproperty: data acquisition tag
Example <jsp:useBean id="date" class="java.util.Date" scope="session"/> //获取月份的属性 <jsp:getPrope…… -
JSP Out. Clear() method: clear the data in the buffer
clear() Example <% out.println("C语言中文网"); out.clear(); %> -
JSP Request. Getcontentlength() method: get the length of the requested body
getContentLength() Example <% int len = request.getContentLength(); out.println("请求内容的长度为:"+len); …… -
Java Map. Containskey() method: judge whether the map collection object contains the specified key name
containsKey(Object key) Typical application public static void main(String[] args){ Map map = new HashMap(); //…… -
JSP Request. Removeattribute() method: deletes an attribute in the request
removeAttribute(String name) Example <% request.removeAttribute("name"); request.removeAttribute("sex"); …… -
JSP application. Getmajorversion() method: returns the maximum version number of servlet API supported by the server
getMajorVersion() Example <% int i=application.getMajorVersion(); out.print(i); %> -
JSP config. Getservletname() method: get the name of the servlet
getServletName() Example <% String name = config.getServletName(); out.println("Servlet name is:"+name); %…… -
Jsp: fallback: prompt tag
…… < Jsp: fallback > error message < / JSP: fallback >... < / JSP: plugin > is set here Exam…… -
Java List. Remove() method: removes the specified element from the list
Grammar 1 remove(int index) Example public static void main(String[] args){ List<String>list = new ArrayL…… -
JSP Request. Getattributenames() method: returns the name collection of all attributes
getAttributeNames() Example <% request.setAttribute("name","zs"); //设置name属性 request.setAttribute("age…… -
JSP Response. Getcharacterencoding () method: get the character encoding type of the response
getCharacterEncoding() Example <% String encode = response.getCharacterEncoding(); out.println("响应客户端…… -
JSP Response. Addheader() method: add HTTP header information
addHeader(String name,String value) Example <%=new Date()%> <% response.addheader("Refresh","1"); …… -
Java Map. Put() method: get all the key names of the map collection
put(K key,V value) Example public static void main(String[] args)throws InterruptedException{ Map map = new Has…… -
Java List. Clear() method: removes all elements from the list
clear() Example public static void main(String[] args){ List<String>list = new ArrayList<String>();…… -
JSP PageContext. Release() method: release related resources
release() Example <% pageContext.release(); %> -
Detailed explanation of Java one-dimensional array: Java creates one-dimensional array, initializes one-dimensional array, and obtains single / all elements
Create a one-dimensional array 数据类型数组名[]; //声明数组 数据类型[]数组名; //声明数组 int[] score; /…… -
JSP application. Getresourcepaths() method: returns all files in the specified directory
getResourcePaths(String path) Example <% Set set = application.getResourcePaths("/"); //返回装载指定路径列表…… -
JSP Request. Getheadersnames() method: returns the names of all request headers
getHeaderNames() Example <% Enumeration cts = request.getHeaderNames(); while(cts.hasMoreElements()){ …… -
JSP Request. Getintheader () method: get the corresponding header information in the client request
getIntHeader(String name) Example <% out.println(request.getIntHeader("Expires")); %> -
Java List. Get () method: get the element at the specified position in the list
get(int index) Typical application public static void main(String[] args){ List<String>list = new ArrayLi…… -
JSP application. Getattributenames() method: get all attribute names
getAttributeNames() Example <% Enumeration names = application.getAttributeNames(); while(names.hasMoreElem…… -
JSP Response. Getoutputstream () method: get the output stream of the JSP response object
getOutputStream() Example <% ServletOutputStream os = response.getOutputStream(); os.write("<b>Java编…… -
JSP Response. Addinthead() method: add the int attribute of the corresponding name
addIntHeader(String name,int value) Example <% response.addIntHeader("Expires",10); %> -
Role of Java currentthread() method
Example 1 public class Run1 { public static void main(String[] args) { //调用currentThread()方法…… -
JSP PageContext. Handlepageexception() method: throw an exception
Grammar 1 handlePageException(Exception e) Example <%@page language="java" pageEncoding="GBK" errorPage="error.js…… -
JSP page instruction: page instruction
<%@page [language="java"] [contentType="mimeType;charset=CHARSET"] [import="{package.class|pageage.*},……"] [extends…… -
The role of the Java getid () method
package ch14; public class Test15 { public static void main(String[] args) { Thread runThread=T…… -
Basic knowledge of Java network programming
Network classification Network programming model Client / Server Mode Browser / Server Mode Network protocol IP protoc…… -
JSP Request. Getmethod () method: get the method that the client transmits data to the server
getmethod() Example <% String mName = request.getmethod(); out.println("表单提交请求使用的方法是:"+mName); …… -
JSP Response. Addcookie() method: add cookie object
addCookie(Cookie cookie) Example <% Cookie cookie = new Cookie("user","lzw"); response.addCookie(cookie); …… -
Java connection string
Using join operators Example 1 public static void main(String[] args) { int[] no=new int[]{501,101,204,102,334……