| Author |
Struts template tag does not work properly in VisualAge for Java WTE
|
Gudavy Hu
Greenhorn
Joined: Apr 11, 2002
Posts: 7
|
|
Code: 1. file "mytemplate.jsp": <%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %> <HTML> <HEAD> </HEAD> <BODY> <TABLE WIDTH="760"> <TR> <TD ALIGN="center" VALIGN="top"> <template:get name='headerframe'/> </TD> </TR> </TABLE> <TABLE WIDTH="760"> <TR> <TD HEIGHT="10" ALIGN="center" VALIGN="top"></TD> </TR> </TABLE> <TABLE> <TR> <TD> <TABLE WIDTH="760"> <TR> <template:get name='leftframe'/> <TD WIDTH="15"></TD> <TD VALIGN="top"> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"> <TR> <TD VALIGN="top" WIDTH="412"> <template:get name='content'/> </TD> </TR> </TABLE> </TD> </TR> </TABLE> </TD> </TR> </TABLE> </BODY> </HTML> 2. file "headerFrame.jsp": <%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %> <%@ taglib uri='/WEB-INF/tlds/struts-bean.tld' prefix='bean' %> <!--Start the header--> <TABLE> <TR> <TD WIDTH="1"></TD> <TD WIDTH="200" HEIGHT="60" ALIGN="CENTER"> <IMG height=48 alt="my picture" src="myImage.gif" width=140></TD> <TD WIDTH="1"></TD> <TD WIDTH="558"> </TD> </TR> </TABLE> <!--end of header --> 3.file "leftFrame.jsp": <%@ taglib uri='/WEB-INF/tlds/struts-bean.tld' prefix='bean' %> <%@ taglib uri='/WEB-INF/tlds/struts-logic.tld' prefix='logic' %> <%@ taglib uri='/WEB-INF/tlds/struts-html.tld' prefix='html' %> <!-- start the left frame --> <TD WIDTH="159"> <TABLE WIDTH="159"> <TR> <TD VALIGN="CENTER" ALIGN="CENTER" WIDTH="159"> <TABLE WIDTH="157"> <TR> <TD WIDTH="10"></TD> <TD> the content list ...... </TD> </TR> </TABLE> </TD> </TR> </TABLE> </TD> <!-- end of the left frame --> 4. file "myContent.jsp": <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <!-- start the content --> <table> <tr> <td colspan="2"></td> </tr> <tr> <td>Some content</td> <td>Some content</td> </tr> </table> <!-- end of the content --> 5. file "index.jsp": <%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %> <template:insert template='mytemplate.jsp'> <template ut name="title" content="Welcome to the My Web Site!" direct="true"/> <template ut name='headerframe' content='headerFrame.jsp' /> <template ut name='leftframe' content='leftFrame.jsp'/> <template ut name='content' content='myContent.jsp' /> </template:insert> 6. after starting the "Websphere Test Environment" in VAJ, and loading the "index.jsp", the page is displayed, but in a mass. The following is the source of the page I got by "view source": <!-- start the header --> <TABLE> <TR> <TD WIDTH="1"></TD> <TD WIDTH="200" HEIGHT="60" ALIGN="CENTER"> <IMG height=48 alt="my picture" src="myImage.gif" width=140></TD> <TD WIDTH="1"></TD> <TD WIDTH="558"> </TD> </TR> </TABLE> <!-- end of header --> <!-- start the left frame --> <TD WIDTH="159"> <TABLE WIDTH="159"> <TR> <TD VALIGN="CENTER" ALIGN="CENTER" WIDTH="159"> <TABLE WIDTH="157"> <TR> <TD WIDTH="10"></TD> <TD> the content list ...... </TD> </TR> </TABLE> </TD> </TR> </TABLE> </TD> <!-- end of the left frame --> <!-- start the content --> <table> <tr> <td colspan="2"></td> </tr> <tr> <td>Some content</td> <td>Some content</td> </tr> </table> <!-- end of the content --> <HTML> <HEAD> </HEAD> <BODY> <TABLE WIDTH="760"> <TR> <TD ALIGN="center" VALIGN="top"> </TD> </TR> </TABLE> <TABLE WIDTH="760"> <TR> <TD HEIGHT="10" ALIGN="center" VALIGN="top"></TD> </TR> </TABLE> <TABLE> <TR> <TD> <TABLE WIDTH="760"> <TR> <TD WIDTH="15"></TD> <TD VALIGN="top"> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"> <TR> <TD VALIGN="top" WIDTH="412"> </TD> </TR> </TABLE> </TD> </TR> </TABLE> </TD> </TR> </TABLE> </BODY> </HTML> How Can I make it work properly? The code works well without any problem in Tomcat. Thanks!
|
 |
Kevin HOVER
Greenhorn
Joined: May 31, 2002
Posts: 6
|
|
|
I've had the same problem with WSAD : you should add in the GET Tags.
|
 |
markchen
Greenhorn
Joined: Jun 27, 2002
Posts: 4
|
|
Hi Kenzo, How could you make Struts work in WSAD? Thanks in advance! Mark Chen
|
 |
Matthew Phillips
Ranch Hand
Joined: Mar 09, 2001
Posts: 2676
|
|
markchen, JavaRanch has a naming policy which is strictly enforced. Please read the policy and change your display name if you wish to continue posting here. Thanks.
|
Matthew Phillips
|
 |
 |
|
|
subject: Struts template tag does not work properly in VisualAge for Java WTE
|
|
|