• Session expiration setting and its application in JSP web.xml Configuration learning


    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 […]

  • Jsp + Ajax to achieve no refresh (the mouse leaves the text box to verify the user name) implementation ideas


    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 […]

  • Implementation of exit principle and code after system login in JSP


    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: […]

  • Implementation skills of three level linkage pull down menu with JSP + DWR


    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″?> […]

  • JSP include reference non directory page implementation code


    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”%>

  • Summary of the implementation process of JSP custom tag taglib


    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 […]

  • JSP built in object: brief introduction and use of request and response


    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 […]

  • Operation steps of generating random number verification code by SSH


    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 […]

  • Introduction to Java Web


    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 […]

  • Struts 2 accessing servlet sharing


    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 […]

  • The solution that action in struts 2 can’t return JSON after implementing modelDriven


    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 […]

  • s: Set and s: date are used to judge the date in JSP


    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>