script language="javascript"> var pos,str,para,parastr,tempstr1; tempstr=""; //接收url str = window.location.href; pos = str.indexOf("?") parastr = str.substring(pos+1); document.write(" 文件路径:"+str); if (pos>0){ document.write(" 所有参数:"+parastr); } else { document.write ("无参数"); } if (str.indexOf("&")>0){ para = parastr.split("&"); for(i=0;iscript> 本文来自ChinaUnix博客,如果...
by leaslie - php文档中心 - 2006-03-29 14:39:18 阅读(905) 回复(0)
jsp中获得当前应用的相对路径和绝对路径 根目录所对应的绝对路径:request.getRequestURI() 文件的绝对路径 :application.getRealPath(request.getRequestURI()); 当前web应用的绝对路径 :application.getRealPath("/"); 取得请求文件的上层目录:new File(application.getRealPath(request.getRequestURI())).getParent() Servlet中获得当前应用的相对路径和绝对路径 根目录所对应的绝对路径:request.getServletPath(); 文件...
OS 是 Solaris Web 服务器是 iPlanet 请问 jsp 中怎么得到Web 的根目录在系统中的绝对路径? 比如得到 "/usr/opt/SUNWapp/roothome/" 这个字符串 谢谢
System.out.println("根目录所对应的绝对路径:" + request.getServletPath() + ""); String strPathFile = request.getSession().getServletContext().getRealPath(request.getRequestURI()); System.out.println("文件的绝对路径:" + strPathFile + ""); String strDirPath = new File(request.getSession().getServletContext().getRealPath(request.getRequestURI())).getParent(); System.out.println("目录的绝对路径...
Date now = new Date(); out.println(DateFormat.getTimeInstance().format(now)); jsp to display the current time The current time is: 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/7965/showart_55812.html
%@ page contentType="text/html; charset=gb2312" language="java" import="java.io.*" errorPage="" %> html> head> meta http-equiv="Content-Type" content="text/html; charset=gb2312"> title>Untitled Document/title> /head> body> 当前WEB应用的物理路径:%=application.getRealPath("/")%>BR> 当前你求请的jsp文件的物理路径: %=application.getRealPat...
对于tomcat的容器,尝试这个容器的编码改一下 在server.xml的 中加入 URIEncoding="UTF-8" 修改后是这样 (上述出自: http://zhidao.baidu.com/question/48824138.html ) 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/65478/showart_1078631.html
script language="javascript"> function chk(){ var obj = document.getElementsByName('imgposition'); for (i=0;iobj.length;i++){ if (obj.checked){ alert(obj.value); return; } } alert('你没选'); } //--> /script> form name=form1> input type="radio" name="imgposition" value="1"> inpu...
1. % java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); java.util.Date currentTime = new java.util.Date();//得到当前系统时间 String str_date1 = formatter.format(currentTime); //将日期时间格式化 String str_date2 = currentTime.toString(); //将Date型日期时间转换成字符串形式 %> 2. SCRIPT LANGUAGE="javascript"> var myDate = new Date(); myDate.getY...