I have a jsp page, which imports another jsp. This import is wrapped into div tag. Also I have parameter with values "true/false", which arrives from servlet as a request parameter. I wonder what's the way to change mentioned visibility(with the help of "style.display" attribute) using the request parameter value. The div should be visible/invisible immediately after page loads. Any ideas? Thanks in advance.
I have a jsp page, which imports another jsp. This import is wrapped into div tag. Also I have parameter with values "true/false", which arrives from servlet as a request parameter. I wonder what's the way to change mentioned visibility(with the help of "style.display" attribute) using the request parameter value. The div should be visible/invisible immediately after page loads. Any ideas? Thanks in advance.
Share Improve this question edited Jun 17, 2012 at 17:23 Vyacheslav Sermyazhko asked Jun 17, 2012 at 17:17 Vyacheslav SermyazhkoVyacheslav Sermyazhko 3592 gold badges4 silver badges13 bronze badges2 Answers
Reset to default 5If you don't want to display a JSP fragment (it can be a fragment that import another JSP) I would avoid to use "style.display
attribute and I would do this:
<c:if test="${myVariable}">
// import jsp, whatever you want
</c:if>
This is better that to import the jsp and them hide it.
you can use
<%
if("true".equalsIgnoreCase((String)request.getAttribute("true"))){
%>
<div class="message_div">
// div given for style .. if div is not there too its fyn
//import jsp here
</div>
<%
}
%>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745566660a4633434.html
评论列表(0条)