Examples of param actions in JSP and details of jspparam instances
Examples of param actions in JSP
1. Syntax
<Jsp: param name = "parameter name" value = "parameter value">
It is often used with <jsp: forward> as its sub-tag.
Code 2
1. login. jsp
<% @ Page language = "java" import = "java. util. * "contentType =" text/html; charset = UTF-8 "%> <% String path = request. getContextPath (); String basePath = request. getScheme () + ": //" + request. getServerName () + ":" + request. getServerPort () + path + "/"; %> <! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN">
2. dologin. jsp
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3. user. jsp
<% @ Page language = "java" import = "java. util. * "contentType =" text/html; charset = UTF-8 "%> <% String path = request. getContextPath (); String basePath = request. getScheme () + ": //" + request. getServerName () + ":" + request. getServerPort () + path + "/"; %> <! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN">
Three running results
If you have any questions, please leave a message or go to the community on this site for discussion. Thank you for reading this article. Thank you for your support!