Category:JSP
-
Time:2021-4-23
The expiration time of session needs to be configured in Tomcat web.xml Time is measured in minutes. Another maximum time seems to be 24 hours. That is to say, your session expiration time can be set to 1440. If it is set to 1441, it is invalid. (not tested yet) Copy codeThe code is as […]
-
Time:2021-4-22
Jsp + Ajax to achieve no refresh, the mouse leaves the text box to verify the user name, the operation is as follows: create a new input page, named input.jsp , Copy codeThe code is as follows: <%@ page contentType=”text/html; charset=utf-8″%> <html> <head> < title > JSP + Ajax to achieve no refresh_ Leave the […]
-
Time:2021-4-21
First of all, write a hyperlink somewhere on your login page: Copy codeThe code is as follows: <a href=” exit.jsp ” target=”_ Top > Exit</a> Let it link to exit.jsp Go to the page and create a new one exit.jsp The page writes the following code in its body: Copy codeThe code is as follows: […]
-
Time:2021-4-20
I see some examples on the Internet. For a simple three-level linkage, struts, hibernate and other frameworks are added. This Ajax linkage has nothing to do with these frameworks. Why is a small demo so big. Today I did an example of DWR + JSP.web.xml: Copy codeThe code is as follows : <?xml version=”1.0″ encoding=”UTF-8″?> […]
-
Time:2021-4-19
Using relative pathSuppose the current directory name is a and the destination folder is B(1) If B is the superior directory of a, Copy codeThe code is as follows: <%@ include file=”../xxx.jsp”%> (2) If B is a subdirectory of a, Copy codeThe code is as follows: <%@ include file=”b/xxx.jsp”%>
-
Time:2021-4-18
Introduction to taglib instruction Taglib instruction, in fact, is to define a tag library and custom tag prefix. For example, the tag library supported in struts, HTML tag library, bean tag library and logic tag library. We just want to introduce the specific implementation methods. We will give you a macro perspective and solve the […]
-
Time:2021-4-17
Request object of JSP built-in objectThe client’s request information is encapsulated in the request object, through which we can understand the customer’s needs, and then make a response. It is an instance of the HttpServletRequest class.Serial number method description1 object getattribute (string name) returns the attribute value of the specified attribute2 enumeration getattributenames() returns an […]
-
Time:2021-4-16
1、 login.jsp Page program Copy codeThe code is as follows: <script type=”text/javascript”> function changeValidateCode(obj) { //Get the current time as a parameter, no specific significancevar timenow = new Date().getTime(); //Each request requires a different parameter, otherwise the same verification code may be returned//This has something to do with the browser’s caching mechanism. You can also […]
-
Time:2021-4-15
Main concepts in Web Development1. Static resources: unchangeable. html、js、css2. Dynamic resource: Java Web. Output or generate static resources. (the page users see in the browser is always a static resource)3. Java EE: a collection of thirteen technologies. JSP / servlet is one of them.Container: (server). Support what technology server, referred to as XX container. Heavyweight […]
-
Time:2021-4-14
1: Access or add the request / session / application property Copy codeThe code is as follows: public String scope() throws Exception{ ActionContext ctx = ActionContext.getContext(); ctx.getApplication (). Put (“app”, “application scope”); / / put the app into ServletContext ctx.getSession (). Put (“session”, “session range”); / / put session into session ctx.put (“req”, “request […]
-
Time:2021-4-13
Copy codeThe code is as follows: public class DeviceAction extends AbstractAction implements ModelDriven<Device> { private static Log log = LogFactory.getLog(DeviceAction.class);Private device device = new device(); / / can only JSON model driven beansPrivate string result; / / unable to return the JSON value of result public String getResult(){ return result; } public void […]
-
Time:2021-4-12
Copy codeThe code is as follows: <s:set name=”todayDay” value=”new java.sql.Date(new java.util.Date().getTime()).toString()”/><s:date name=”Schd_Dpt_Dt” format=”yyyy-MM-dd” var=”Schd_Dpt_Date”/> <s:if test=”#todayDay==#Schd_Dpt_Date”> <td> <s:date name=”Schd_Dpt_Dt” format=”HH:mm” /> </td></s:if><s:else> <td> <s:date name=”Schd_ Dpt_ DT “format =” DD day HH: mm “/ > </td></s:else>