该用户从未签到
|
<% //String servletPath=request.getServletPath();
+ X+ a' h' b) c- m, i+ V // int end =servletPath.lastIndexOf('/')+1;8 Q/ y) s! E1 J% W$ U8 ]
//System.out.println(end);
) o# I6 g7 p% P+ } //String photoPath=servletPath.substring(0,end);# M1 ^" W, `; q3 r* ?$ H
String path=request.getRequestURI();3 N2 G2 |4 T& P# i
//System.out.println(path);
* Q g& b0 d( P3 B int end =path.lastIndexOf('/')+1;
2 [3 r7 @& V& I; j" L" X% ~ String photoPath=path.substring(0,end);3 H6 [8 n3 u( ^2 R2 |5 b
System.out.println(photoPath);
0 b- t r. y$ u. m; h% Y %>
- B# s n( x+ n6 |" h: k<script language="javascript">
/ p6 a2 p" y+ j# z function showPic(obj) {4 h0 Y0 c- U$ j. f
var o = document.getElementById("showimg");
9 J5 b+ N5 n4 L$ z& ^" k% w var b = document.getElementById("photoPath");6 X! L/ U( v6 F. n
var i=obj.value.lastIndexOf('s')+2;
. f' G5 @4 R* ] o3 R: M var j=obj.value.length;
' T g ~. F( x2 V7 [. h0 R //var a = document.image.value;1 e1 `: i1 ?5 x. R+ r
//var int j=a.length;" P2 E6 M9 ]; P; p& q- p4 e, R
//var i=a.lastIndexOf('s')+2;
/ B0 i# q0 f, [. M2 K1 ?* ] var filename=obj.value.substring(i,j);
$ {1 Q8 j1 [6 O4 X: d. ` o.src=b.value+"images/"+filename;8 }0 \: `8 J5 @; C$ M7 `
o.style.display="";
* w9 ?+ F& D9 C, o5 I o.border=1;
6 Z- ] H2 z& ~# } }
7 ~" V: _& `( Z6 G</script>1 N! E" G( j' p# v' A# W8 ^
<form>! x# \0 F, \/ p* q3 z" |$ `- o
<input name="image" type="file" id="image" size="50" >
( r- M$ {* A; }" V3 [<div align="center"><img name="showimg" id="showimg" src="" style="display:none;" alt="预览图片" /></div>
+ o9 r! C% b# R</form> |
|