JSP study notes (4) ----- JSP action

xiaoxiao2021-03-06  89

1. This example mainly tells us how to use JSP actions in JSP code, such as

2. This example requires four files: login.jsp, test.jsp, ok.htm, no.htm

3. Let's take a look at Login.jsp

Username



Password



4. TEST.JSP code is as follows:

<%

String Username = Request.getParameter ("UserName");

IF (Username.trim (). Equals ("ABC")))

{%>

<%}

Else

{%>

<%}

%>

5. Ok.htm and NO.htm are very simple, just write:

OK

no

6. Finally, it is configured, very simple:

Putting login.jsp, test.jsp, ok.htm, no.htm can be in J2EE's public_html, no need to start J2EE deployment, this is a simple method

7. Running is the page automatically jumps to the OK.htm page when you enter the user name ABC. Otherwise, jump to the no.htm page.

转载请注明原文地址:https://www.9cbs.com/read-122285.html

New Post(0)