该用户从未签到
|
<% //String servletPath=request.getServletPath(); - {3 B! x- b L' ^7 D! @1 ?
// int end =servletPath.lastIndexOf('/')+1;
9 ^* ^8 V- p& m0 T //System.out.println(end);
1 `, {& W+ E8 ^7 C+ e7 U, t) B //String photoPath=servletPath.substring(0,end);8 x$ P( q% d' F s
String path=request.getRequestURI();9 Y" y6 s3 J) ]3 e' a# ]
//System.out.println(path);% w/ r; S M) u! X1 H, F
int end =path.lastIndexOf('/')+1;
' `, H }! c: \! f String photoPath=path.substring(0,end);
% d0 B {, T J% X System.out.println(photoPath);
2 m' P, }0 I9 z/ G/ a. @0 M3 D %>
3 r5 H+ Z- l' Q<script language="javascript">
8 e) v. |) p: ?0 d/ U3 L& x0 N function showPic(obj) {
" g/ z9 M( ]) b* |/ E9 ` var o = document.getElementById("showimg");
, n( t9 S; b% G- B var b = document.getElementById("photoPath");
5 e" I/ N I- \+ s" B- @ var i=obj.value.lastIndexOf('s')+2;. m* `, X! K6 f* \$ F& W- q
var j=obj.value.length;( Q1 {5 w/ z9 o Z" ~* z+ V+ D- q
//var a = document.image.value; `9 [9 |! O9 J% [% S5 E
//var int j=a.length;6 M+ C6 T4 a+ n- I/ T) k5 Z2 @
//var i=a.lastIndexOf('s')+2;
, o) u9 b3 C6 R; j: a; W var filename=obj.value.substring(i,j);
4 |9 {% r7 q' j. v b6 I. v o.src=b.value+"images/"+filename;
6 B2 B0 O4 o3 X: [2 E o.style.display="";/ ?' U( |5 J4 Z% ^
o.border=1;
+ M. M2 m! w6 w8 K }
+ K8 I4 [$ L. F4 B" ^+ U</script>
r& R2 O( j( F' i<form>
% G' \; E# m, c! v2 |4 Q<input name="image" type="file" id="image" size="50" >. f3 d7 t6 _9 ~) b( \
<div align="center"><img name="showimg" id="showimg" src="" style="display:none;" alt="预览图片" /></div>+ J0 I5 l( y ^
</form> |
|