You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Security Management <li...@secmgmt.com> on 2009/08/18 19:56:40 UTC

List Iterator in JSP

My actions have a method, called getJavascriptIncludes() which returns a
List<String> object.

I'm iterating like so, in the head:

<s:iterator value='javascriptIncludes'>
	<s:set name="js_file" value="[0]"/>
	<script type="text/javascript" src="<s:url
value='%{js_file}'/>"</script>
</s:iterator>

Here's what's generated:

<script type="text/javascript" src="[/pages/getpic/js/getpic_lib.js,
com.secmgmt.struts2.actions.common.IndexAction@4b7c69,
com.opensymphony.xwork2.DefaultTextProvider@658bbe]"</script>

How do I get it to be just the first thing in that list?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: List Iterator in JSP

Posted by Security Management <li...@secmgmt.com>.
Duh, it's:

<s:set name="js_file" value="top"/>

-----Original Message-----
From: Security Management [mailto:list-subscriptions@secmgmt.com] 
Sent: Tuesday, August 18, 2009 1:57 PM
To: 'Struts Users Mailing List'
Subject: List<String> Iterator in JSP

My actions have a method, called getJavascriptIncludes() which returns a
List<String> object.

I'm iterating like so, in the head:

<s:iterator value='javascriptIncludes'>
	<s:set name="js_file" value="[0]"/>
	<script type="text/javascript" src="<s:url
value='%{js_file}'/>"</script>
</s:iterator>

Here's what's generated:

<script type="text/javascript" src="[/pages/getpic/js/getpic_lib.js,
com.secmgmt.struts2.actions.common.IndexAction@4b7c69,
com.opensymphony.xwork2.DefaultTextProvider@658bbe]"</script>

How do I get it to be just the first thing in that list?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org