Hi,

Can anyone tell me why use tiles-defs?

I used "traditional" structs from an Action class forward/redirect to
a jsp file.
With tiles-defs, I just simply added "code" to this file to achieve
the url redirection.

Case scenario:

I want to forward to two different search jsp files from another jsp
file (main.jsp).


In tiles-defs.xml file, I have added something like this:
        <definition name="portlet.shopping.search" extends="portlet.shopping">
                <put name="portlet_content"
value="/portlet/shopping/search.jsp" />
        </definition>
        <definition name="portlet.shopping.search_v2"
extends="portlet.shopping">
                <put name="portlet_content"
value="/portlet/shopping/search_v2.jsp" />
        </definition>

In main.jsp file I use the following code to forward to either search_v2.jsp:
<liferay-portlet:renderURL windowState="<%=
WindowState.MAXIMIZED.toString() %>"
varImpl="searchURL"><portlet:param name="struts_action"
value="/shopping/search_v2" /></liferay-portlet:renderURL>

<form action="<%= searchURL %>" method="get" name="<portlet:namespace
/>fm1" onSubmit="submitForm(this); return false;">
<liferay-portlet:renderURLParams varImpl="searchURL" />
<input name="<portlet:namespace />redirect" type="hidden" value="<%=
HtmlUtil.escape(currentURL) %>" />
<input name="<portlet:namespace />breadcrumbsCategoryId" type="hidden"
value="<%= categoryId %>" />
<input name="<portlet:namespace />searchCategoryIds" type="hidden"
value="<%= categoryId %>" />


Thanks
Sam

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

Reply via email to