php function - jsp eşdeğer

0 Cevap php

php ben bunu:

<?php
function displaySomething($list) {
    foreach ($list as $item) {
    ?>
        <html code here><?php echo $item["field"] ?><html code again etc>
    <?php } 
}
?>

Ve sonra benim sayfada farklı yerlerde farklı listeleri görüntülemek için kullanabilirsiniz.

Jsp bunu başarmak için bir yolu var mı? Ben java ile html birleştirebilirsiniz hangi parametrelerle yöntemleri oluşturma?

<%! %> admits only java code, can't cut in with html code.

0 Cevap