javascript - Displaying Bootstrap Modal in Java -


i've got login system made in java project, , want display twitter bootstrap's modal java code on jsp page. possible? i've tried invoking javascript function, doesn't work because javascript client side , java server side.

i've tried printing script tag in java, doesn't work either. can print modal in java (with ) can't dismiss then.

the modal i'm trying display:

<!-- login modal --> <div class="modal fade" id="loginmodal" tabindex="-1" role="dialog" aria-labelledby="loginmodallabel" aria-hidden="true">   <div class="modal-dialog">     <div class="modal-content">       <div class="modal-header">         <h3 class="modal-title" id="loginmodallabel"> sample title</h3>       </div>       <div class="modal-body">         <p>sample text</p>       </div>       <div class="modal-footer">         <button type="button" class="btn btn-block" data-dismiss="modal">close</button>       </div>     </div>   </div> </div> 

the java code

//checks if username , password exist current selected building if(logindao.validate(name, pass, build, session))     {                    response.sendredirect("/bigdata/dashboard.jsp");       }     else{         // want show modal here     rd= request.getrequestdispatcher("login.jsp");         rd.include(request,response);     } 

for reference: twitter bootstrap modal: http://getbootstrap.com/javascript/#modals

you can print code in jsp run on page load. go on page after java code have decided modal needs shown.:

<script type="text/javascript"> $(document).ready( function(){    $("#loginmodal").modal();  } ); </script> 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -