求救:jsp页面中如何定义和引用变量?

来源:百度知道 编辑:UC知道 时间:2024/06/08 12:29:56
这个变量在<head>与</head>之间引用。
如:
<head>
声明变量=style200810
<link href="引用变量值.css" rel="stylesheet" type="text/css" />
</head>

<head>
<%
String css = "style200810";
%>
<link href="<%=css%>.css" rel="stylesheet" type="text/css" />
</head>

或者:
<head>
<%
String css = "style200810.css";
%>
<link href="<%=css%>" rel="stylesheet" type="text/css" />
</head>
这中问题在百度上已经有很多了 ,你静下心来就能找到你想要的答案

<%
    ……
    String strCss = null;
    ……
    strCss = ……;
    ……
%>
<jsp:directive.page contentType="……" />
<html>
    <head>
        ……
        <link href="<%=strCss %>" rel="stylesheet" type