aspose file tools*
The moose likes Struts and the fly likes struts2 tag produces unwanted tr and td tags which effects my design so it give rise to design issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2 tag produces unwanted tr and td tags which effects my design so it give rise to design issue" Watch "struts2 tag produces unwanted tr and td tags which effects my design so it give rise to design issue" New topic
Author

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

Rajesha Acharya
Greenhorn

Joined: Mar 18, 2013
Posts: 23
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>
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

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


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Rajesha Acharya
Greenhorn

Joined: Mar 18, 2013
Posts: 23


thanks but i figured it out, i was missing theme=simple on my <form>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts2 tag produces unwanted tr and td tags which effects my design so it give rise to design issue