Struts tab--Resolve tags automatically add tr td problem _struts

Source: Internet
Author: User

In fact, this problem has long been aware of, but did not solve it, decided to first set the back of the function to say, now finally resolved. is not a big problem, that is, in the JSP page added struts label is not good typesetting, the page does not show the position of the label is consistent with, baffled by that time, now open Google Browser inspection, and then found that he automatically will be more TR TD some things.

JSP page

<div class= "Form-group" >
     <s:select name= "department.id"  list= "list" class= "Form-control" listKey= "id" listvalue= "dname" id= "department" >        
     /s:select>                                 
</div>

Foreground HTML

<div class= "Form-group" >
<tr>
    <td class= "Tdlabel" ></td>
    <td>
    < Select Name= "department.id" id= "department" class= "Classjava.util.HashMap" >
        <option value= "1" > Academic Department < /option>
        <option value= "2" > Personnel </option>
        <option value= "3" > Finance Dept. </option>
        <option value= "4" > Department </option>
        <option value= "5" > Logistics </option>
        <option value= "7 "> Admin </option>
    </select>
    </td>
</tr>
</div>

So always row bad version ah.
Workaround:
①, in Struts.xml, plus

On behalf of all the pages are simple theme, when it output the page, not back to add any extra code, such as table TR TD, and so on, we can edit the page like other ways to edit the style of the page
②, add theme= "simple" in the label
Reference Blog: http://blog.csdn.net/naivesoft/article/details/6563084

In fact, before watching the learning video to knock code is also used Theme= "simple", but did not know that the role AH-learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.