各位前辈,我想将html代码中的标签转换成struts标签。不知道从何下手。而且用struts标签代码中就不能用中文,我该怎么办?转换的过程中我应该注意什么问题啊???谢谢!!!

解决方案 »

  1.   

    你说的“html代码中的标签”是指什么标签啊,得把代码贴出来看看啊,
    一个个给你讲标签工程量比较大啊
      

  2.   

    别嫌我笨哦,我是真的不懂。我就是想把下面这些代码里<>里的东东,换成struts的。应该可以改吧?<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html
      <head>
        <base  href="<%=basePath%>">
        
        <title>My JSP 'production_information.jsp' starting page</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="styles.css">
    -->
     
    <script type="text/JavaScript">
    <!--
    function MM_goToURL() { //v3.0
      var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
      for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
    }
    //-->
    </script><link href="style/style.css" rel="stylesheet" type="text/css">
    </head><script>
    function del(){
    if(confirm("确认删除?")){

    }
    }
    </script>
      
      <body><br><br><br><br><div align="center"><b>报修产品一览信息</b><br></div><br><table width="1089" border="1" align="center" cellpadding="0" cellspacing="0" height="157">
    <tbody>
      <tr>
        <th width="90"><div align="center">报修单号</div></th>
        <th width="190"><div align="center">单位名称</div></th>
        <th width="160"><div align="center">联系人</div></th>
        <th width="130"><div align="center">产品类型</div></th>
        <th width="140"><div align="center">机器型号</div></th>
        <th width="120"><div align="center">预订价</div></th>
        <th width="70"><div align="center">打印状态</div></th>
        <th width="170">&nbsp;</th>
      </tr>
      <tr>
        <td><br></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><input name="Submit" type="submit" onClick="MM_goToURL('self','change_pro_infomation.jsp');return document.MM_returnValue" value="修改">
        <input type="submit" name="Submit2"  onClick="del()" style="cursor:pointer" value="删除">
        <input name="Submit3" type="submit" onClick="MM_goToURL('self','print_pro_detail.jsp');return document.MM_returnValue" value="打印"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </tbody></table><br>
      </body>
    </html>
      

  3.   

    页面输出用<bean:write>,循环用<logic:iterate>,提交按钮可以用<html:submit>
    帮你改了一点你可以参照着改
    <%@   page   language= "java "   import= "java.util.* "   pageEncoding= "GB18030 "%> 
    <% 
    String   path   =   request.getContextPath(); 
    String   basePath   =   request.getScheme()+ ":// "+request.getServerName()+ ": "+request.getServerPort()+path+ "/ "; 
    %> <!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.01   Transitional//EN "> 
    <html 
        <head> 
            <base     href= " <%=basePath%> "> 
            
            <title> My   JSP   'production_information.jsp '   starting   page </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= "styles.css "> 
    --> 
      
    <script   type= "text/JavaScript "> 
    <!-- 
    function   MM_goToURL()   {   //v3.0 
        var   i,   args=MM_goToURL.arguments;   document.MM_returnValue   =   false; 
        for   (i=0;   i <(args.length-1);   i+=2)   eval(args[i]+ ".location= ' "+args[i+1]+ " ' "); 

    //--> 
    </script> <link   href= "style/style.css "   rel= "stylesheet "   type= "text/css "> 
    </head> <script> 
    function   del(){ 
    if(confirm( "确认删除? ")){ } 

    </script> 
        
        <body> 
        <html:form method="post" action="******">
        
        <br> <br> <br> <br> <div   align= "center "> <b> 报修产品一览信息 </b> <br> </div> <br> <table   width= "1089 "   border= "1 "   align= "center "   cellpadding= "0 "   cellspacing= "0 "   height= "157 "> 
    <tbody> 
        <tr> 
            <th   width= "90 "> <div   align= "center "><bean:write name="******" property="******" /></div> </th> 
            <th   width= "190 "> <div   align= "center "><bean:write name="******" property="******" /></div> </th> 
            <th   width= "160 "> <div   align= "center "><bean:write name="******" property="******" /></div> </th> 
            <th   width= "130 "> <div   align= "center "><bean:write name="******" property="******" /></div> </th> 
            <th   width= "140 "> <div   align= "center "><bean:write name="******" property="******" /></div> </th> 
            <th   width= "120 "> <div   align= "center "><bean:write name="******" property="******" /></div> </th> 
            <th   width= "70 "> <div   align= "center "><bean:write name="******" property="******" /></div> </th> 
            <th   width= "170 "> &nbsp; </th> 
        </tr> 
        
        <tr> 
            <td> <br> </td> 
            <td> &nbsp; </td> 
            <td> &nbsp; </td> 
    <td> &nbsp; </td> 
            <td> &nbsp; </td> 
            <td> &nbsp; </td> 
            <td> &nbsp; </td> 
            <td> <input   name= "Submit "   type= "submit "   onClick= "MM_goToURL( 'self ', 'change_pro_infomation.jsp ');return   document.MM_returnValue "   value= "修改 "> 
            <input   type= "submit "   name= "Submit2 "     onClick= "del() "   style= "cursor:pointer "   value= "删除 "> 
            <input   name= "Submit3 "   type= "submit "   onClick= "MM_goToURL( 'self ', 'print_pro_detail.jsp ');return   document.MM_returnValue "   value= "打印 "> </td> 
        </tr> 
    <logic:present name="C100200Form" property="result">
      <logic:iterate id="result" name="C100200Form" property="result" indexId="idx">
        <tr> 
            <td><bean:write name="******" property="******" /></td> 
            <td><bean:write name="******" property="******" /></td> 
            <td><bean:write name="******" property="******" /></td> 
            <td><bean:write name="******" property="******" /></td> 
            <td><bean:write name="******" property="******" /></td> 
            <td><bean:write name="******" property="******" /></td> 
            <td><bean:write name="******" property="******" /></td> 
            <td><bean:write name="******" property="******" /></td> 
        </tr> 
      </logic:iterate>
    </logic:present>
    </tbody> </table> <br> </html:form>
        </body> 
    </html>