• 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

Usage of Struts tags

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>


<%@ page import="java.util.ArrayList %>


<%
StampDutyReportForm stampDutyReportForm = (StampDutyReportForm)request.getAttribute("SDForm");
if(stampDutyReportForm == null)
stampDutyReportForm = new StampDutyReportForm();
%>

<HTML>
<HEAD>
<TITLE> Stamp Duty Register</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<link href="css/css.css" rel="stylesheet" type="text/css">
</HEAD>

<BODY>
<%! ArrayList alSDReport = null;
String stampDutyReport = null;
%>
<form action="/SDReport">
<span class="black_bold">STAMP DUTY REPORT<br>
<br>
</span>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor=""><TABLE Border= "1" cellpadding="3" cellspacing="1">
<TR class="wht_bold" rowspan="2">
<td>Transaction Date </td>
<td>Tax transaction </td>
<td>property</td>
<td>Security Description </td>
<td>Price in Local Currency </td>
<td>Local Currency </td>
<td>Exchange Rate to Base Currency </td>
<td>Transaction Type</td>
<td>Name,place </td>
<td colspan="3" align="center" valign="middle">Proceeds in CHF </td>

</TR>
<%
stampDutyReport = request.getParameter("SDReport");

if(stampDutyReport.equals("FAILURE"))

out.println("<h4><font color=red>No Records Available For This Client</h4>");

%>
<!--- <%
clientNames = (java.util.ArrayList)session.getAttribute("CLIENTNAMES"); --->
<TR bgcolor="#FFFFFF" >
<% alSDReport = (java.util.ArrayList)session.getAttribute("SDReport");

if(alSDReport != null && alSDReport.size() > 0){
int sum = 0;
for(int i=0; i<alSDReport.size(); i++)
{ %>

<TR bgcolor="#FFFFFF" class="black_normal">
<TD height="25"><%=alSDReport.get(i)%></TD>
<%
try {
x += Integer.parseInt( (String) alSDReport.get(i));
} catch (Exception e) {
}
%>
</TR>

<%
}
out.println(sum);
}
%>

</TR>
<input type="Submit" Value="open PDF">
</form>
</BODY>
</HTML>

how can i convert this jsp to struts based jsp. I mean by using tag libraries and what are the changes i need to make in action and BO clasess.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The logic in the page you've shown us could easily be handled by either JSTL tags or Struts tags. I personally prefer JSTL tags as they are more powerful and more standard.

My suggestion would be to read up on the tag libraries you want to use and try converting it yourself. Then if you run into problems, we can help you solve them.

If you decide to use JSTL, the tags you'll be most interested in are <c:forEach> and <c:out>. If you decide to use Struts tags, you'll want to look at <logic:iterate> and <bean:write>.
[ December 24, 2006: Message edited by: Merrill Higginson ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic