Struts2 scriptlet

Posted by Bret on Stack Overflow See other posts from Stack Overflow or by Bret
Published on 2010-05-05T19:05:16Z Indexed on 2010/05/05 19:08 UTC
Read the original article Hit count: 161

Filed under:
|
|
|

Using struts2 with jsp with standard struts tag libraries.

I'm trying to dynamically hide a DIV on page load, but still send it to the browser. This is so I can show it later via javascript.

The request objects one and two are not easily referenced via a jsp:usebean tag. (They are enums and cannot be instantiated) I tried using a combination of s:if tags or c:if tags and it just looks ugly.

<%
    String displayStr = "display: none;";
    if(request.getAttribute("one") != null || request.getAttribute("two") != null  ) {
        displayStr = "display: block;";
    }
 %>

<div id="next" style="<%=displayStr %>">

Any suggestions for a better way to do this?

© Stack Overflow or respective owner

Related posts about struts2

Related posts about scriptlet