• 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

struts2 tag produces unwanted tr and td tags which effects my design so it give rise to design issue

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello sir. i recently started to learn struts2 directly without having any knowledge on struts1. i already started up with my first project to upload files using struts2. i have completed this project by my own, so functionality works very fine but i have an issue with the design. struts2 framework unwantedly produce tr and td tags so when output is displayed on the jsp page, it will sit in different blocks, so please help me out with this design issue with the struts2.
here is my code.



<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">@import url("menu.css");</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

<script language="javascript" type="text/javascript">
var x = 0;
function submitFunction1(y){
x = y;
}

function submitFunction(i)
{
if(i == x){
document.forms["theForm"].action="submitpendingreport?userid="+i;
document.forms["theForm"].submit();
return true;
}else{alert("Press correct Button");
return false;
}
}
</script>
</head>

<body background="images/bg27.jpg">
<s:form id="theForm" method="post" enctype="multipart/form-data" >
<h2><font sytle="text-align:left" color="red"> <strong>Welcome <s:property value="#session.a" />

<p align="left" > Admin Page<p>

<center><strong><p style="font-family:verdana;color:red;">Welcome To Student Assignment/Report Submission form</p></center></strong>
<table width='100%' height='90%' border='1'>
<tr align='center'>
<td height='39' colspan='2'>
<strong><a href="user.jsp">Home</a>         
<a href="AboutUs.jsp">AboutUs</a>         
<a href="Geneology.jsp">Geneology</a>         
<a href="Clients.jsp">Clients</a>         
<a href="ContactUs.jsp">ContactUs</a>         
<a href="Logout.jsp">LogOut</a></strong></td>
</tr>
<tr>


<td width='18%' height='500' valign='middle'><p> </p><blockquote>
<a href="pendingreports">View Pending Report</a><br/><br/><br/>
<a href="Submitreport.jsp">Submit Report</a><br><br><br>
<a href="viewsubmit">View Submitted Report</a><br><br><br>
</blockquote></td>

<td width='82%' colspan='2' align="left" >




<TABLE BORDER="1" >
<TR>
<TH width="1px">id</TH>
<TH>Subject</TH>
<TH>Action</TH>
<TH>Status</TH>

</TR>



<s:iterator value="reportList" var="record">
<TR>
<TD> <s:property value="#record.id"/> </TD>
<TD> <s:property value="#record.subject"/> </TD>
//i get here in this line, this line produces unwanted tr and td tags// <TD> <s:file name="pending" onchange="submitFunction1(%{#record.id})"/> <s:submit onclick="submitFunction(%{#record.id})"/> </TD>
<TD> <s:property value="#record.reportStatus"/> </TD>
</TR>

</s:iterator>

</TABLE>
</td>
</tr></table>
</s:form>
</body>
</html>
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Struts 2 FAQ: Why do the form tags put table tags around controls?
 
Rajesha Acharya
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Ess wrote:Struts 2 FAQ: Why do the form tags put table tags around controls?



thanks but i figured it out, i was missing theme=simple on my <form>
 
reply
    Bookmark Topic Watch Topic
  • New Topic