首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

传值有关问题,求教

2012-01-14 
传值问题,求教页面代码:%@pagelanguage java pageEncoding GBK %%@tagliburi http://jakarta.a

传值问题,求教
页面代码:
<%@   page   language= "java "   pageEncoding= "GBK "%>

<%@   taglib   uri= "http://jakarta.apache.org/struts/tags-bean "   prefix= "bean "   %>
<%@   taglib   uri= "http://jakarta.apache.org/struts/tags-html "   prefix= "html "   %>
<%@   taglib   uri= "http://jakarta.apache.org/struts/tags-logic "   prefix= "logic "   %>
<%@   taglib   uri= "http://jakarta.apache.org/struts/tags-tiles "   prefix= "tiles "   %>
<%@   taglib   uri= "http://jakarta.apache.org/struts/tags-template "   prefix= "template "   %>
<%@   taglib   uri= "http://jakarta.apache.org/struts/tags-nested "   prefix= "nested "   %>

<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.01   Transitional//EN ">
<html:html   locale= "true ">
    <head>
        <html:base   />
       
        <title> <bean:write   name= "photoInfo "   property= "phototitle "/> </title>

<meta   http-equiv= "pragma "   content= "no-cache ">
<meta   http-equiv= "cache-control "   content= "no-cache ">
<meta   http-equiv= "expires "   content= "0 ">        
<meta   http-equiv= "keywords "   content= "keyword1,keyword2,keyword3 ">
<meta   http-equiv= "description "   content= "This   is   my   page ">
<link   rel= "stylesheet "   type= "text/css "   href= "style.css ">
<script   type= "text/javascript ">
<!--
var   flag=false;
function   DrawImage(ImgD){
var   image=new   Image();
image.src=ImgD.src;
if(image.width> 0   &&   image.height> 0){
flag=true;
if(image.width/image.height> =   164/112){
if(image.width> 164){  
ImgD.width=164;
ImgD.height=(image.height*164)/image.width;
}else{
ImgD.width=image.width;  
ImgD.height=image.height;
}
ImgD.alt=image.width+ "× "+image.height;
}else{
if(image.height> 450){  
ImgD.height=570;
ImgD.width=(image.width*570)/image.height;  
}else{
ImgD.width=image.width;  
ImgD.height=image.height;
}
ImgD.alt=image.width+ "× "+image.height;
}
}
}  
function   submit(){
document.all.form1.submit();
}
function   firm(id){//利用对话框返回的值   (true   或者   false)
        if(confirm( "你确要删除这张照片吗? "))
        {//如果是true   ,那么就把页面转向thcjp.cnblogs.com
                location.href= "/blog/photoad.do?action=del&photoid= "   +   id;
        }
        else
        {//否则说明下了,赫赫
               
        }
}

//-->
</script>


    </head>
   
    <body   bgcolor= "#C6D700 ">
    <%
    String   blogIDS=(String)session.getAttribute( "blogid ");
      %>
    <table   width= "620 "   align= "center "     bgcolor= "white "   height= "100% "   border= "1 ">
    <tr>
    <td   width= "10% "> </td>
    <td   valign= "top "   width= "80% "   align= "center ">
    <table   align= "center "   border= "0 "   width= "620 ">
    <tr   width= "100% ">
    <td   align= "center ">
        <table   border= "0 "   width= "100% "   align= "center ">
        <tr>
                <td   width= "8% "> </td>
        <td   width= "92% "   align= "left "> <a   href= "photoIndex.jsp "> <b> 相册首页| </b> </a>
        <logic:equal   name= "isGuest "   value= "true ">
        <a   href= "/blog/class.do?classAction=classList&blogID= <%=blogIDS   %> "> <font   color= "#74c151 "> 上传照片 </font> </a> <b> | </b>  
        </logic:equal>    
        相册容量:( <bean:write   name= "size "/> M/100M) </td>
        </tr>
        </table>
        </td>
        </tr>
        <tr   width= "100% ">
    <td   align= "right ">
        <table   width= "620 "   border= "0 ">
    <tr>  
    <td   valign= "top "   colspan= "3 "   align= "center "   width= "90% ">
    <img   height=470   width= "750 "   src= " <bean:write   name= "photoInfo "   property= "filename "/> "   onload= "DrawImage(this); "/> <br/>
    </td>
    </tr>
    <tr>
          <td   width= "30 "   > </td>
    <td   width= "700 ">
    <br/>
    <font   color= "#74c151 "> 上传者: </font> <FONT   class= "xyl7 "> <bean:write   name= "photoInfo "   property= "promulgator "/> </FONT>
    &nbsp;&nbsp;&nbsp;&nbsp; <font   color= "#74c151 "> 日期: </font> <FONT   class= "xyl7 "> <bean:write   name= "photoInfo "   property= "photoupdate "/> </FONT>
    &nbsp;&nbsp;&nbsp;&nbsp; <font   color= "#74c151 "> 大小: </font> <FONT   class= "xyl7 "> <bean:write   name= "photoInfo "   property= "filesize "/> K


    &nbsp;&nbsp;&nbsp;&nbsp;
    <logic:equal   name= "isGuest "   value= "true ">
    <img   width= "18 "   title= "删除 "   height= "18 "   src= "../image/del.gif "   onclick= "firm( <bean:write   name= "photoInfo "   property= "photoid "/> ) "/>
    </logic:equal>
    <br/>
   
    <font   color= "#74c151 "> 标题: </font> <FONT   class= "xyl7 "> <bean:write   name= "photoInfo "   property= "phototitle "/> </FONT> <br/>
    <font   color= "#74c151 "> 分类: </font> <FONT   class= "xyl7 "> <bean:write   name= "className "/> </FONT> <br/>
    <font   color= "#74c151 "> 描述: </font> <FONT   class= "xyl7 "> <bean:write   name= "photoInfo "   property= "photoinfo "/> </FONT> <br/> <br/>
    </td>
    </tr>
    <logic:notEqual   name= "isGuest "   value= "guest ">
    <html:form   action= "/remark ">
    <tr> <td   colspan= "2 "   width= "100% "> <hr/> </td> </tr>
    <tr>
    <td   width= "30 "> </td>
    <td   width= "700 "> 评论: </td>
    </tr>
    <logic:iterate   id= "remarkID "   name= "remarkList ">
    <tr>
    <td   width= "30 "> </td>
    <td   width= "700 ">
    <hr   width= "300 "   align= "left "/>
    <bean:write   name= "remarkID "   property= "retruename "/>
    &nbsp;&nbsp;&nbsp;&nbsp; <bean:write   name= "remarkID "   property= "remarkdate "/>
   
    <br/> <bean:write   name= "remarkID "   property= "content "/>
   
    </td>
    </tr>
    </logic:iterate>
    <tr>
    <td   width= "30 "> </td>
    <td   width= "700 "> <html:textarea   property= "content "   cols= "50 "   rows= "5 "   value= " "/> </td>
    </tr>
    <tr>
<html:hidden   property= "action "   value= "addRemark "/>
<input   type= "hidden "   name= "classname "   value= "aaa "/>
<input   type= "hidden "   name= "photoID "   value= " <bean:write   name= "photoInfo "   property= "photoid "/> "/>
    <td   width= "30 "> </td>


    <td   width= "700 "> <img   src= "../image/xc1_14.gif "   onclick= "submit(); "/> </td>
    </tr>
    </html:form>
    </logic:notEqual>
    </table>
    </td>
        </tr>
    </table>
    </td>
    <td   width= "10% "> </td>
    </tr>
    </table>
   
    </body>
</html:html>

action中用
String   photoID=request.getParameter( "photoID ");
String   classname=request.getParameter( "classname ");
接受,
photoID的值就能接收到,classname的值就接受不到,十分不解,请各位指教

[解决办法]
LZ我有不解之处呀???使用STRUTS都是用ACTIONFORM获得数据在传入ACTION您直接在ACTION中获得与MODEL2有区别吗。。。。。。。。。。。。。。您贴出这么长代码 我估计能有耐心看一半的人都不多。。。。。。。。。。

热点排行