tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Muneer Malik <tutti...@gmail.com>
Subject Re: MutableTilesContainer
Date Fri, 09 Sep 2011 14:55:26 GMT
For example at the end of a servlet call.
If you use a framework, then you can do it at the end of an
action/command/whatever, wherever you have access to the request/response
pair.

Antonio

For your above comment, I cannot put the code in the action since after the
action is completed
the Struts2 looks at the tiles destination and forwards the request.

For example:
<action name="submitHeparinMedication"
 class="net.polymorphic.emr.heparinmedication.action.submitHeparinMedication">
<interceptor-ref name="patientProfileInterceptor"></interceptor-ref>
<interceptor-ref name="secureStack"></interceptor-ref>
<result name="success" type="tiles">submitHeparinMedication.tiles</result>
<result type="redirect" name="error">/welcome.action</result>
<result type="tiles" name="input">addHeparinMedication.tiles</result>
</action>

so are you suggesting may be the code has to go somewhere in the struts2
tiles plugin?

Thanks

On Fri, Sep 9, 2011 at 9:47 AM, Antonio Petrelli <antonio.petrelli@gmail.com
> wrote:

> 2011/9/9 Muneer Malik <tutti786@gmail.com>
>
>>  2011/9/9 Muneer Malik <tutti786@gmail.com>
>>>
>>>> public class CustomTilesContainerFactory extends
>>>> BasicTilesContainerFactory {
>>>> ...
>>>>
>>>> do you want me to add the following in the above class;
>>>>
>>>> @Override121 <http://tiles.apache.org/2.2/framework/tiles-extras/xref/org/apache/tiles/extras/complete/CompleteAutoloadTilesContainerFactory.html#121>
    *protected* BasicTilesContainer instantiateContainer(122 <http://tiles.apache.org/2.2/framework/tiles-extras/xref/org/apache/tiles/extras/complete/CompleteAutoloadTilesContainerFactory.html#122>
            TilesApplicationContext applicationContext) {123 <http://tiles.apache.org/2.2/framework/tiles-extras/xref/org/apache/tiles/extras/complete/CompleteAutoloadTilesContainerFactory.html#123>
        *return* *new* CachingTilesContainer();124 <http://tiles.apache.org/2.2/framework/tiles-extras/xref/org/apache/tiles/extras/complete/CompleteAutoloadTilesContainerFactory.html#124>
    }
>>>>
>>>>
>>>>
> Exactly.
>
>
>>
>>>> and if I want to use Tiles API
>>>>
>>>> where that java code should go, in the same above class or a seperate class.
>>>>
>>>>
>>>> I see the link which you suggested:
>>>>
>>>>
>>>> MutableTilesContainer container = TilesAccess.getContainer(
>>>>         request.getSession().getServletContext());
>>>> Definition definition = new Definition();
>>>> definition.setTemplate("/layouts/my_layout.jsp");
>>>> definition.putAttribute("body", new Attribute("/tiles/body.jsp");
>>>> container.register(definition, request, response);
>>>>
>>>>
>>>>
>>>> where the above code should go?
>>>>
>>>>
> For example at the end of a servlet call.
> If you use a framework, then you can do it at the end of an
> action/command/whatever, wherever you have access to the request/response
> pair.
>
> Antonio
>
>


-- 
Confidentiality Notice
-------------------------------


THIS INFORMATION IS INTENDED ONLY FOR THE USE OF THE ADDRESSEE AND MAY
CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM
DISCLOSURE UNDER APPLICABLE LAW.  IF YOU ARE NOT THE INTENDED RECIPIENT, OR
THE EMPLOYEE OR AGENT RESPONSIBLE FOR DELIVERING THIS MESSAGE TO THE
INTENDED RECIPIENT, YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION,
DISTRIBUTION OR COPYING OF THE COMMUNICATION IS STRICTLY PROHIBITED.  IF YOU
HAVE RECEIVED THIS COMMUNICATION IN ERROR, PLEASE NOTIFY IMMEDIATELY AT
tutti786@gmail.com OR BY TELEPHONE AT 817-458-1764.


THANK YOU.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message