小知识
James Bond Wu
这个作者很懒,什么都没留下…
展开
-
anaconda配置R详细记录
下载anaconda程序https://www.anaconda.com/products/individual下载MACOS版本安装之后界面如下下一步配置新的运行环境然后在新配置的环境中用MAC的terminal打开终端打开终端后倒入包安装R packages命令如下conda install -c r r-dplyr然后用Jupyter打开即新建一个R的编辑文件使用R了注意:一定不要忘记配置R,以及建立新环境后的安装R到这个新的环境中,打开终端操作比较方便一行命令搞定co原创 2020-09-19 23:17:47 · 1760 阅读 · 0 评论 -
Basic knowledge about cookies in client - server interaction
What is a cookie?Cookies are usually small text files, given ID tags that are stored on your computer’s browser directory or program data subfolders. Cookies are created when you use your browser to visit a website that uses cookies to keep track of your原创 2020-09-06 06:20:28 · 104 阅读 · 0 评论 -
Basic knowledge of session and cookies and the differences between session and cookies
Introduction of cookie and sessionSessions and cookies are two very common web concepts, and are also very easy to misunderstand. However, they are extremely important for the authorization of pages, as well as for gathering page statistics. Let’s take a原创 2020-09-06 11:16:53 · 162 阅读 · 0 评论 -
An easy application by using jsp and servlet to control user login and logout
The whole program layout in the eclipseThe front end including index.jsp, login.jsp, memberArea.jsp and the back end including two servlet to handle login and logout functionindex.jspThis page will has one Login button, click it will direct user to the原创 2020-09-06 06:53:06 · 130 阅读 · 0 评论 -
Using session attribute to handle logout from a page
IF we only need to handle login and logout, cookie is not a good idea, we can handle login and logout by using session attributeFor example when we click the logout button, the servlet to handle the logout function will get the action is destroy and then原创 2020-09-06 06:23:05 · 148 阅读 · 0 评论 -
How to use cookie to log out from website
1. login.jsp to get the username and password from user<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><!DOCTYPE html><html><head><meta charset="UTF-8"><title>Insert title原创 2020-09-06 06:22:25 · 198 阅读 · 0 评论 -
Basic Introduction of Session
Session introductionsession称为“会话控制”,Session 对象存储特定用户会话所需的属性及配置信息。当程序需要为某个客户端的请求创建一个session时,服务器首先检查这个客户端是否包含一个session标识(即JSESSIONID)。 如果是第一次请求服务器,服务器会创建session,并创建Cookie,在Cookie中保存Session的id,发送给客户端,这样客户端就有了自己的session的id了。但这个Cookie只在浏览器内存中存在,也就是说,在关闭浏览器原创 2020-09-06 03:37:27 · 168 阅读 · 0 评论 -
JavaBean class in Java
JavaBeans are classes that encapsulate many objects into a single object (the bean). It is a java class that should follow following conventions:Must implement Serializable.It should have a public no-arg constructor.All properties in java bean must be原创 2020-09-05 22:20:12 · 197 阅读 · 0 评论 -
Basic form validations
By adding required to the Full name: , means that this text box must be filled before submit<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transiti原创 2020-09-04 19:19:45 · 149 阅读 · 0 评论 -
JSP - Form - Servlet 的doGet()和doPost()方法简单交互
jsp form代码记得form的action应该是servlet的地址URL,method为get或者post```html<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>Form demo Full name: Gender: Male Female Lan原创 2020-09-04 19:07:02 · 587 阅读 · 0 评论 -
Form elements for HTML
Defines an input control for the form Defines a multiline(text area) input control for the form Defines a label for an element for the form Groups related elements in a form for the form Defines a caption for a element for the form Defines a drop-d.原创 2020-09-04 18:34:42 · 111 阅读 · 0 评论 -
Java Web jsp && servlet 实现简单的MVC控制
1. What is MVC?MVC Pattern stands for Model-View-Controller Pattern. This pattern is used to separate application’s concerns.Model: Handles data and business logic.View: Presents the data to the user whenever asked for.Controller: Entertains user reque原创 2020-09-04 11:24:27 · 214 阅读 · 1 评论 -
Life Cycle of Servlet && Corresponding Java Methods
Life Cycle of Servlet1) Loading of Servlet2) Creating instance of Servlet3) Invoke init() once4) Invoke service() repeatedly for each client request5) Invoke destroy()Step 1: Loading of ServletWhen the web server (e.g. Apache Tomcat) starts up, the原创 2020-09-04 07:42:02 · 146 阅读 · 0 评论 -
常见的实现servlet的三种形式
常见的实现servlet的三种形式package com.xxxx.servlet;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletRespon原创 2020-09-04 07:18:36 · 276 阅读 · 0 评论 -
Servlet Servlet的工作流程
如何理解路径如下例子http://localhost:8080/s01/ser01localhost代表主机8080为端口号/s01为项目路径/ser001为项目下的资源路径原创 2020-09-04 07:06:13 · 170 阅读 · 0 评论 -
Servlet的WebServlet注解详解
1. 如何实现Servlet,代码如下package com.xxxx.servlet;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResp原创 2020-09-04 06:57:49 · 956 阅读 · 0 评论 -
IntelliJ says ‘cannot run program ‘/path/to/tomcat/bin/catalina.sh‘ error=13 permission denied
今天我在IntelliJ Idea中新建了一个Java EE的project之后发现Edit Configuration我选择Tomcat的local之后run不了,显示错误如下:IntelliJ says 'cannot run program ‘/path/to/tomcat/bin/catalina.sh’ error=13 permission denied。后来在网上查了下,发现有可能是我的Tomcat的包下错了,我的PC是MAC,好像应该用tar.gz (pgp, sha512)。应该下tar原创 2020-09-04 06:20:30 · 493 阅读 · 0 评论 -
MAC & Tomcat & Startup & ShutDown
如何从Terminals启动Tomcat服务器我的Tomcat安装包路径为/Library/ApacheTomcat进入到目录的bin目录下,路径为/Library/ApacheTomcat/bin输入 cd /Library/ApacheTomcat/bin 进到 Tomcat 的 bin 目录下输入 sudo chmod 755 *.sh 设置权限输入 sudo sh startup.sh 启动 Tomcat。在浏览器中输入 localhost:8080 看到 Tomcat 主页即为成功。原创 2020-09-04 05:12:13 · 126 阅读 · 0 评论