jsp中js参数传递问题

<%
List list =(List)session.getAttribute("FunctionList");
Iterator it = list.listIterator();
FunctionBean temp;
while(it.hasNext())
{
temp=it.next();
/
.................
.................
/

}
%>

FunctionBean是用户的菜单类,是用来做权限用的,我现在权限已获得,想在上面冒号中调用js的代码,请问要怎么做。
最好给个例子。

d = new dTree('d'); <% String str = (String)request.getAttribute("str"); String[] ar = str.split("@"); for(int i=0;i<ar.length;i++){ %> d.add(<%=ar[i]%>); <%}%> document.write(d);

jsp中输出html是以out.print/println
[code="jsp"]
<%
boolean is = true;
if(is){
out.println("&quot;);<br> out.println(&quot;alert(&#39;在这里写你的代码&#39;);&quot;);<br> out.println(&quot;");
}else{
out.println("&quot;);<br> out.println(&quot;alert(&#39;你的权限不够&#39;);&quot;);<br> out.println(&quot;");

}
%>
[/code]

直接嵌入js代码就性了啊。
%>

//js do <% //java code %>

<%