该用户从未签到
|
<% //String servletPath=request.getServletPath(); & b2 z$ c6 ^6 |& W6 p; x4 B2 k2 `
// int end =servletPath.lastIndexOf('/')+1;- h* _ p! v: o5 Q4 e
//System.out.println(end);
4 `9 v8 D2 W7 a* X //String photoPath=servletPath.substring(0,end);
3 ~( a& Y- _% K6 z String path=request.getRequestURI();
; Q2 I# P) I3 m. r5 G& E //System.out.println(path);, h( G% Y; {& @2 K3 t
int end =path.lastIndexOf('/')+1;
4 a8 H; w1 x/ d; p String photoPath=path.substring(0,end);, R& y- l, }7 n3 i* g
System.out.println(photoPath);
* g0 H3 L7 {+ c %>
2 T/ g# x& Q, {& x1 C3 t# n7 h<script language="javascript">/ h' x6 h y. }/ y
function showPic(obj) {$ M7 ?" P, w" y& a" [
var o = document.getElementById("showimg");
+ O! i% u" }! y+ O0 S# ? var b = document.getElementById("photoPath");
) F4 Z. m! k- M+ L# C/ k- G' r1 s! u var i=obj.value.lastIndexOf('s')+2;
' L! P5 x: Y# @- g8 v var j=obj.value.length;
& J0 u" w; A, ?. [' E- g/ K //var a = document.image.value;
& f8 y: t) c, q% W7 |( z% Z# _ //var int j=a.length;, |- v9 @* ?& w6 ]6 p& J
//var i=a.lastIndexOf('s')+2;
" ]- x4 J1 z- w5 | var filename=obj.value.substring(i,j);- j! O7 |! Z6 k( [
o.src=b.value+"images/"+filename;
! a/ L& c& C) d7 c' F5 \% W# l" i. I o.style.display="";. J, i E# C: d' k+ Z
o.border=1;
; G; N% l: n" L( V# v9 B1 A4 r }, {* t, e- ]: x
</script>6 H, K; g8 e9 X. N% V n
<form>
3 s [3 m# ?( X2 g9 M<input name="image" type="file" id="image" size="50" >
' K Y* u2 Y) R: Q: C ?5 k/ a6 W<div align="center"><img name="showimg" id="showimg" src="" style="display:none;" alt="预览图片" /></div>
: Y% W( R1 q1 m: P* d& L</form> |
|