• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts template tag does not work properly in VisualAge for Java WTE

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've had the same problem with WSAD : you should add in the GET Tags.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kenzo,
How could you make Struts work in WSAD?
Thanks in advance!
Mark Chen
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic