该用户从未签到
|
<% //String servletPath=request.getServletPath(); $ v3 r# P( }, d, H
// int end =servletPath.lastIndexOf('/')+1;3 Z' @5 a) b& S0 [0 R3 J
//System.out.println(end);0 X( n! F' b. }) {. \
//String photoPath=servletPath.substring(0,end);
- @: _4 N; ?& [( U( }! y. r String path=request.getRequestURI();
- _, O4 b' ]8 u8 q& Y //System.out.println(path);1 `% ]" q& s% n0 j+ g2 n7 y8 p' S
int end =path.lastIndexOf('/')+1;
2 B3 _( X: e) {6 ]' \: O5 x+ z* Q String photoPath=path.substring(0,end);# p2 x% E% r$ s: q: S8 b
System.out.println(photoPath);" E4 c0 c( Q" x' b
%>$ @8 D* l3 `* _- \7 E
<script language="javascript">
9 V, }! _3 S7 r4 ^" l3 \9 }2 k) ^( K+ ] function showPic(obj) {" W5 R. M( S: O% b% i; t
var o = document.getElementById("showimg");0 L2 ~7 [3 V6 Y
var b = document.getElementById("photoPath");
' A& E! w1 B6 y) c: V5 X5 G var i=obj.value.lastIndexOf('s')+2;
- @: A9 i+ v* w( i# n var j=obj.value.length;
" y5 F( n' |, N9 Q: [/ e; e //var a = document.image.value;
& f `$ ?; d) y //var int j=a.length;% ?/ T+ w. x; x2 `- ^ e" G
//var i=a.lastIndexOf('s')+2;
0 v3 |* c" j8 R3 x4 t$ n var filename=obj.value.substring(i,j);
; f' \9 t- _- A0 w o.src=b.value+"images/"+filename;* \3 s( D6 e2 S9 l0 z1 q1 s
o.style.display="";
- n- j& h7 Y5 L! E o.border=1;, V3 J p1 a7 t1 Y2 G' l, M
}
6 V4 x' q9 f! K</script>
- g3 o e6 e3 c# T7 A<form>2 [: h1 d* L$ N; U
<input name="image" type="file" id="image" size="50" >
3 [ c4 M1 V" s% F0 }<div align="center"><img name="showimg" id="showimg" src="" style="display:none;" alt="预览图片" /></div>
7 {* r1 c1 G% Q* ? ?+ Q</form> |
|