该用户从未签到
|
<% //String servletPath=request.getServletPath();
' Y7 u! o, L, b+ U @5 M // int end =servletPath.lastIndexOf('/')+1;
% v& V( `, ]2 L2 I" ?, l //System.out.println(end);
$ ^* \! Z6 Y" i$ m //String photoPath=servletPath.substring(0,end);
& g& W- i; ^* R0 ` String path=request.getRequestURI();7 }$ z) l" V. Q4 `
//System.out.println(path);
& _1 T/ {9 V7 g$ q& Q* J int end =path.lastIndexOf('/')+1;
1 B& W; ?8 E2 \% b8 Z& H. d String photoPath=path.substring(0,end);% s# e, Q8 L2 c$ O# n. H$ a
System.out.println(photoPath);7 O; r0 p4 p- P& f, L9 N
%>
* B( U6 A* f' p: m<script language="javascript">
) [0 {1 j0 _% J, w1 V) L U function showPic(obj) {+ O/ T4 Y! ]( K2 G( T9 P% b/ ~
var o = document.getElementById("showimg");$ g! v0 K7 r2 {
var b = document.getElementById("photoPath");
$ Q& w: N, P! v7 z: T) q var i=obj.value.lastIndexOf('s')+2;
" g0 M/ {* c- Q x) B) P# \$ |$ ` var j=obj.value.length;
1 C$ L% X0 y, S //var a = document.image.value;0 b2 D; q! e( P) e' h
//var int j=a.length;
# ]8 q3 ?/ N( ^ //var i=a.lastIndexOf('s')+2;
. Y8 Y2 G1 J7 }* q) C3 p3 a var filename=obj.value.substring(i,j);
0 m/ A8 F- N; \# t$ h% w# v o.src=b.value+"images/"+filename;. @# h3 U" g/ W
o.style.display="";9 R9 L2 Y; e% R, v) V$ I! h3 \
o.border=1;2 ^4 V( f5 Z/ y4 D! R4 k/ s2 u, b
}# o8 h' A" n: I, b
</script>5 W' h: P% _5 U, A
<form>
- W/ N+ ?: D+ w, |<input name="image" type="file" id="image" size="50" >! B. g5 W6 l: F) j
<div align="center"><img name="showimg" id="showimg" src="" style="display:none;" alt="预览图片" /></div>! X: C' T# P6 g
</form> |
|