Struts2 tags in divs appear empty

后端 未结 1 1957
时光取名叫无心
时光取名叫无心 2021-01-29 00:06

I have a s:checkbox inside a html div. When the code is run, the checkbox is outside (both) the div and the divs seem to be empty and nonexistant. Why is this occuring and how c

1条回答
  •  不思量自难忘°
    2021-01-29 00:44

    Like described in this answer (that you should consider upvoting too), Struts2 generates (or not) a certain kind of HTML when rendering Struts Tags, basing on the Theme you have chosen.

    The default one is xhtml, that will generate a lot of stuff for you. It may be handy, but also annoying, according to how you work. Personally I prefer to generate the HTML by myself, and then I use the theme that won't generate almost any HTML: the simple Theme.

    Note that when working on big projects or with multiple projects with the same, particular needs, you can also write your own custom theme (for example for generating security tokens automatically).

    You can use a theme globally (in struts.xml)

    
    

    or locally to a single tag / form:

    
    

    In this case, you may need to write the object by yourself.

    0 讨论(0)
提交回复
热议问题