Hello Hal!

I have limit the functionallity of the Action so it will only change the
content of one tile named body.
------------------------------
<definition name="/layout5/page" page="/layout5/layout.jsp" >
    <put name="header" value="/layout5/header.jsp"/>
    <put name="footer" value="/layout5/footer.jsp"/>
    <put name="menu" value="/layout5/menu.jsp"/>
    <put name="body" value="/layout5/body1.jsp"/>
  </definition>
-------------------------------------
<action
      path="/layout5/page"
      type="layout.BodyChangeAction" >
        <forward
          name="success"
          path="/layout5/page" />
     </action>
  </action-mappings>
---------------------------
http://localhost:8081/layout5/page.do?body=body2.jsp
-----------------------------------------

The url will change "body" in the defintion from body1.jsp to body2.jsp for
this request.

The definition and the action have the same name. If they didn't have the
same name I must send the name of the definition name as an parameter in the
url. I don't know if there is a better way of doing this?

Scary Halloween Regards
Roland Carlsson




----- Original Message -----
From: "Holman, Cal" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Wednesday, October 30, 2002 1:44 PM
Subject: RE: <tiles:put /> in ActionForward.perform()


> Do the tiles definition and the body attribute have the same name?  I
would
> think you would have to pass two parameters - the definition to act on and
> the body attribute to replace.  Or the definition is constant and only the
> body can change.  What does your tiles definition file look like?
>
> Cal
>
> http://www.calandva.com/
>
> -----Original Message-----
> From: Roland Carlsson [mailto:roland.c@;swetravel.se]
> Sent: Wednesday, October 30, 2002 04:04
> To: Struts Users Mailing List
> Subject: Re: <tiles:put /> in ActionForward.perform()
>
> I have solved my own question. If anyone is intrested I past the code
below.
> The change in the definition lasts only for the request and will not make
> any permanent changes.
>
> Regards
> Roland Carlsson
>
>
> public ActionForward perform(
>      ActionMapping mapping,
>      ActionForm form,
>      HttpServletRequest request,
>      HttpServletResponse response)
>  throws IOException, ServletException
>   {
>     String forward = "success";
>     String path = request.getParameter("body");
>     // Change nothing
>     if(path == null || path.equals("")){
>       // do nothing
>     }else{
>       // Try to change body-page
>       ServletContext context =
> this.getServlet().getServletConfig().getServletContext();
>       ComponentDefinition cd = null;
>       try{
>       cd = DefinitionsUtil.getDefinition(path, request, context) ;
>       cd.put("body", request.getParameter("body"));
>       // if something is wrong
>       }catch(Exception e){
>         e.printStackTrace();
>         forward = "error";
>       }
>     }
>     return mapping.findForward(forward);
>   }
>
> ----- Original Message -----
> From: "Roland Carlsson" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, October 29, 2002 4:31 PM
> Subject: <tiles:put /> in ActionForward.perform()
>
>
> > Hi!
> > I'm trying to expand my tiles with a dynamic body. I want to control
this
> > body with a simple parameter in the url eg
> > http://localhost:8081/myPage?body=aTile.jsp . Does anyone have an
example
> of
> > how to do this?
> >
> > Thanks in advance
> > Roland Carlsson
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@;jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:struts-user-help@;jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@;jakarta.apache.org>
>
> Learn more about Paymentech's payment processing services at
www.paymentech.com
> THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are
proprietary and confidential information intended only for the use of the
recipient(s) named above.  If you are not the intended recipient, you may
not print, distribute, or copy this message or any attachments.  If you have
received this communication in error, please notify the sender by return
e-mail and delete this message and any attachments from your computer.
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to