jsp基础编程

jsp页面的使用

<%@ page language=“java” contentType=“text/html; charset=UTF-8”

pageEncoding="UTF-8"%>
Insert title here

定义声明

	<%
		students.setName("shxiinfa");
			students.setAge(22);
	%>
</jsp:useBean>
<%=students.getName()%>
<%=students.getAge()%>
<%!String name = "诸葛亮";
String password = "123456";%>

输出数据

<%=name%>
<%=password%>

定义方法

<%!public static int tt(int n) {
	if (n == 0) {
		return 0;
	} else if (n == 1) {
		return 1;
	} else {
		return tt(n - 2) + tt(n - 1);
	}
}%>
<%=tt(3)%>

作者:言寡
来源:CSDN
原文:https://blog.csdn.net/qq_21406125/article/details/80029693
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/xiaoxiaoyong1234/article/details/85923099