生活随笔
收集整理的這篇文章主要介紹了
jsp页面执行java语法,获取的值在页面调用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
首先在頁面頭引用用到類的包路徑寫需要執行的java語法頁面轉換引用<!-- 引用包路徑 -->
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="com.inspur.icpmg.systemMg.vo.UserEntity"%>
<%@ page language="java" import="com.inspur.icpmg.itss.asset.service.AssetService"%>
<%@ page language="java" import="com.inspur.icpmg.itss.asset.service.AssetServiceImp"%>
<%@ page language="java" import="com.inspur.icpmg.util.WebLevelUtil" %>
<%@ page language="java" import="com.inspur.icpmg.itss.asset.service.AssetInventoryServiceImp" %><!-- 執行java語法 -->
<%UserEntity user = WebLevelUtil.getUser(request);String online = user.getUname();AssetInventoryServiceImp service = new AssetInventoryServiceImp();String cloudcenterid = service.getcloudcenterIdByCityid(user.getCityid());
%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="/web/inc.jsp"></jsp:include>
<title>xxxx</title>
</head><body><!-- 轉換 -->
<script>$(document).ready(function() {cloudcenterid = '<%=cloudcenterid%>';onlineUser = '<%=online%>';});<!-- 使用 -->$('#onlineUser').val(onlineUser);
</script><input type="text" id="onlineUser"/>
?
轉載于:https://www.cnblogs.com/wjup/p/10576083.html
總結
以上是生活随笔為你收集整理的jsp页面执行java语法,获取的值在页面调用的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。