aspose file tools*
The moose likes Struts and the fly likes Show Table from the database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Show Table from the database" Watch "Show Table from the database" New topic

Show Table from the database

Madtoni Delas llagas

Joined: Nov 29, 2005
Posts: 2
hei all,
can any1 help us how to display the table we were doin'.. here's the code... can any1 help us locate where's the error or is der some code we had not declare...

<-- Code of display.jsp -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 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
contentType="text/html; charset=ISO-8859-1"
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet" type="text/css">
<!--html:form action="/display" type="entry.actions.DisplayTech" name="techForm" scope="request"-->
<jsp:useBean id="techlist" class="java.util.ArrayList" scope="request"></jsp:useBean>

<TABLE border="1">
<!--TD>Entry ID</TD-->
<TD>From Point</TD>
<TD>To Point</TD>
<TD>Bounded By</TD>
<TD>Of Plan</TD>
<logic:iterate id="techiterate" name="techlist">
<!--TD><bean:write name="techiterate" property="entry_id"/></TD-->
<TD><bean:write name="techiterate" property="frm_point" /></TD>
<TD><bean:write name="techiterate" property="to_point" /></TD>
<TD><bean:write name="techiterate" property="north" /></TD>
<TD><bean:write name="techiterate" property="south" /></TD>
<TD><bean:write name="techiterate" property="deg" /></TD>
<TD><bean:write name="techiterate" property="min" /></TD>
<TD><bean:write name="techiterate" property="east" /></TD>
<TD><bean:write name="techiterate" property="west" /></TD>
<TD><bean:write name="techiterate" property="dis_one" /></TD>
<TD><bean:write name="techiterate" property="dis_two" /></TD>
<TD><bean:write name="techiterate" property="bound" /></TD>
<TD><bean:write name="techiterate" property="plan" /></TD>
<TD>EDIT<html:link paramId="entry_id" paramProperty="entry_id" paramName="tech" href="updateTech.jsp"></html:link>


<-- Code of (ActionClass) -->
package entry.actions;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import entry.dao.DisplayTechDao;
import entry.forms.TechForm;
import entry.manager.TechManager;

* @version 1.0
* @author
public class DisplayTech extends Action {

public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

ActionErrors errors = new ActionErrors();
ActionForward forward = new ActionForward(); // return value
TechForm techForm = (TechForm) form;
DisplayTechDao displayTechDao = new DisplayTechDao();

try {

TechManager techManager = new TechManager();
ArrayList techlist = techManager.DisplayTech();
request.setAttribute("techlist", techlist);

} catch (Exception e) {

// Report the error using the appropriate name and ID.
errors.add("name", new ActionError("id"));


// If a message is required, save the specified key(s)
// into the request for use by the <struts:errors> tag.

if (!errors.isEmpty()) {
saveErrors(request, errors);
// Write logic determining how the user should be forwarded.
forward = mapping.findForward("display");

// Finish with
return (forward);


Currently, we were using java Struts.

[ ]
Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

I'm moving this to the Struts forum where I think its a better fit -- so please post your replies there. Thanks!
I agree. Here's the link:
subject: Show Table from the database