You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nicolas De Loof <ni...@capgemini.com> on 2004/10/12 11:08:30 UTC

Re: Dynamic html:form tags

Did you try something like this :

       <tiles:useAttribute id="action" name="action"/>
       <html:form action="<%= action %>">
             <tiles:insert attribute="header" flush="false"/>
...
       </html:form>
       </body>

Nico.

> Hi group!
> 
> I have a somewhat complex application with tiles. I have a layout page
> which looks like this:
> 
> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
> 
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> 
> <html>
>       <head>
>             <title><tiles:getAsString name="title"/></title>
>             <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1" />
>             <link rel="stylesheet" href="css/efselect.css">
>             <link rel="SHORTCUT ICON" href="/efselect/img/favicon.ico" />
> 
>             <tiles:insert attribute="head" flush="false"/>
>       </head>
> 
> 
>       <tiles:insert attribute="bodytag" flush="false"/>
> 
>             <tiles:insert attribute="header" flush="false"/>
>             <tiles:insert attribute="user" flush="false"/>
>             <tiles:insert attribute="menu" flush="false"/>
>             <tiles:insert attribute="task" flush="false"/>
> 
>             <tiles:insert attribute="errors" flush="false"/>
> 
> 
> 
>       </body>
> </html>
> 
> In the content tile the html:form is set, as this tile includes the
> information to submit.
> 
> Now I want to surround the complete layout with menu-navigation with the
> form tag instead of using it only in the content tile. This is needed
> because I want the form to submit if the user hits the menu bar. If the
> action were static it would look like the following:
> 
>       <tiles:insert attribute="bodytag" flush="false"/>
>       <html:form action="/somestatic">
>             <tiles:insert attribute="header" flush="false"/>
>             <tiles:insert attribute="user" flush="false"/>
>             <tiles:insert attribute="menu" flush="false"/>
>             <tiles:insert attribute="task" flush="false"/>
> 
>             <tiles:insert attribute="errors" flush="false"/>
> 
>       </html:form>
>       </body>
> </html>
> 
> However, the action is not static so I need to make it dynamic. I've tried
> to include the form tag with another tile, but it doesn't compile the jsp
> page. I've tried to include the action as tiles:getAsString, but it doesn't
> compile either.
> 
> I'm under the impression that this is a common problem (form including
> navigation), but I'm unaware of any solution.
> 
> Thanks in advance
> Karsten Krieg
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.


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


Chaining Actions

Posted by Lee Harrington <le...@gmail.com>.
I'm having a problem calling one action from another.  Both are
dispatch actions.

Action 1 is called, does it's business, sets a request.setAttribute(),
and forwards to Action 2

Action 2 is run, but none of the request variables are there.  I get
nulls with I "request.getAttribute".

Lee

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


Re: Dynamic html:form tags

Posted by Karsten Krieg <kk...@intarsys.de>.
Hi!

Guess I should be reading more taglib documentations. Thanks alot. That
works.

Karsten Krieg



                                                                                                                                                    
                      "Nicolas De Loof"                                                                                                             
                      <nicolas.deloof@cap        An:       "Struts Users Mailing List" <us...@struts.apache.org>                                     
                      gemini.com>                Kopie:                                                                                             
                                                 Thema:    Re: Dynamic html:form tags                                                               
                      12.10.2004 11:08                                                                                                              
                      Bitte antworten an                                                                                                            
                      "Struts Users                                                                                                                 
                      Mailing List"                                                                                                                 
                                                                                                                                                    





Did you try something like this :

       <tiles:useAttribute id="action" name="action"/>
       <html:form action="<%= action %>">
             <tiles:insert attribute="header" flush="false"/>
...
       </html:form>
       </body>

Nico.

> Hi group!
>
> I have a somewhat complex application with tiles. I have a layout page
> which looks like this:
>
> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html>
>       <head>
>             <title><tiles:getAsString name="title"/></title>
>             <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1" />
>             <link rel="stylesheet" href="css/efselect.css">
>             <link rel="SHORTCUT ICON" href="/efselect/img/favicon.ico" />
>
>             <tiles:insert attribute="head" flush="false"/>
>       </head>
>
>
>       <tiles:insert attribute="bodytag" flush="false"/>
>
>             <tiles:insert attribute="header" flush="false"/>
>             <tiles:insert attribute="user" flush="false"/>
>             <tiles:insert attribute="menu" flush="false"/>
>             <tiles:insert attribute="task" flush="false"/>
>
>             <tiles:insert attribute="errors" flush="false"/>
>
>
>
>       </body>
> </html>
>
> In the content tile the html:form is set, as this tile includes the
> information to submit.
>
> Now I want to surround the complete layout with menu-navigation with the
> form tag instead of using it only in the content tile. This is needed
> because I want the form to submit if the user hits the menu bar. If the
> action were static it would look like the following:
>
>       <tiles:insert attribute="bodytag" flush="false"/>
>       <html:form action="/somestatic">
>             <tiles:insert attribute="header" flush="false"/>
>             <tiles:insert attribute="user" flush="false"/>
>             <tiles:insert attribute="menu" flush="false"/>
>             <tiles:insert attribute="task" flush="false"/>
>
>             <tiles:insert attribute="errors" flush="false"/>
>
>       </html:form>
>       </body>
> </html>
>
> However, the action is not static so I need to make it dynamic. I've
tried
> to include the form tag with another tile, but it doesn't compile the jsp
> page. I've tried to include the action as tiles:getAsString, but it
doesn't
> compile either.
>
> I'm under the impression that this is a common problem (form including
> navigation), but I'm unaware of any solution.
>
> Thanks in advance
> Karsten Krieg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,  you
are not authorized to read, print, retain, copy, disseminate,  distribute,
or use this message or any part thereof. If you receive this  message in
error, please notify the sender immediately and delete all  copies of this
message.


---------------------------------------------------------------------
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