You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by "Motley, Jeffery" <Je...@Williams.com> on 2010/08/05 21:32:06 UTC

java scriplet and Tiles 2

I seem to be having a problem doing the following...

 

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"

    pageEncoding="ISO-8859-1"%>

<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>

<%@ page import="com.soa.parties.client.*" %>

<%@ page import="com.soa.parties.model.*" %>

<%@ page import="org.apache.commons.lang.ObjectUtils" %>

<%@ page import="org.apache.commons.lang.StringUtils" %>

<%@ page import="org.apache.commons.lang.WordUtils" %>

 

<%

SuPartiesClient supClient = new SuPartiesClient();

SuParty suParty = supClient.getParty(1);

SuPartySiteRole suPSR = supClient.getPartySiteRole(1,
SuPartySiteRole.ROLE_SO);

SuAddress suAddr = supClient.getAddressId(suPSR.getAddrId());

 

String name = suParty.getName();

 

 

%>

 

<tiles:insertDefiniton name="soa.master">

 

<tiles:putAttribute name="content" cascade="true"> 

                  <div id="content">

                        <div class="padding">

                        

                              <table>

                                    <tr>

                                    <td>Name:</td><td><%=name%></td>

                                    </tr>

                                    

                              

                              </table>

                        

                        </div>

                  </div>

            </tiles:putAttribute>

 

</tiles:insertDefintion>

 

It doesn't seem to like the <%=name%>. When I take it out it works fine.

 

I get the following error in jboss...

 

14:15:44,979 ERROR [[jsp]] Servlet.service() for servlet jsp threw
exception

org.apache.jasper.JasperException: /somgmt/SOContactInfo.jsp(49,49)
Scripting elements ( &lt;%!, &lt;jsp:declaration, &lt;%=,
&lt;jsp:expression, &lt;

%, &lt;jsp:scriptlet ) are disallowed here.

 

I copied my page source and created a new jsp not using Tiles and it
worked fine. Any Ideas?

Thanks

Jeff


Re: java scriplet and Tiles 2

Posted by Antonio Petrelli <an...@gmail.com>.
2010/8/5 Motley, Jeffery <Je...@williams.com>:
> <tiles:putAttribute name="content" cascade="true">
>...
>                                    <td>Name:</td><td><%=name%></td>
> ...
>            </tiles:putAttribute>
> ...
> It doesn't seem to like the <%=name%>. When I take it out it works fine.

Since 2.2.0, Tiles JSP tags are scriptless. For your simple use case,
it's easy to convert using JSTL and EL.

Antonio