Merrill, thanks once again for more of your help.
If I take off the redirect it doesn't result in the correct action being called. Therefore I must have something not quite right. I hope that you can be of more assistance as I am determined not to be beaten by this!!
The way I envisage this to work is
On pressing the Configure button on the Regression.jsp page, it calls the Dispatch_* action which sends it off to Dispatch.java. This returns "configure" to the action which should then call the "result" of that action ie. telling the process to next call the RegressionConfigure action. This is where I must have it wrong as it is not calling that action.
The resulting URL from pressing the configure button is
http://axuapdev01:8080/uapstools2/uaps/Dispatch_configure.action I would be grateful again, for any help that you or anyone can be in helping me to solve this "should be" simple thing.
Many thanks in advance.
Struts.xml -----------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<constant name="struts.devMode" value="true" />
<package name="uaps" namespace="/uaps" extends="struts-default">
<!-- Add actions here -->
<action name="HelloWorld" class="net.uaps.Struts2HelloWorld">
<result>/pages/HelloWorld.jsp</result>
</action>
<action name="Regression" class="net.uaps.regression.Regression">
<result>/pages/regression/Regression.jsp</result>
</action>
<action name="Dispatch_*" class="net.uaps.regression.Dispatch" method="{1}">
<result name="configure">RegressionConfigure</result>
<result name="submit">Submit</result>
<result name="cancel">Cancel</result>
</action>
<action name="RegressionConfigure" class="net.uaps.regression.RegressionConfigure">
<result>/pages/regression/RegressionConfigure.jsp</result>
</action>
<action name="Submit" class="net.uaps.Struts2HelloWorld">
<result>/pages/HelloWorld.jsp</result>
</action>
<action name="Cancel" class="net.uaps.Struts2HelloWorld">
<result>/pages/HelloWorld.jsp</result>
</action>
</package>
<!-- Add packages here -->
</struts>
----------------------------------------------------------
Regression.jsp -------------------------------------------
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Regression
Testing</title>
</head>
<body bgcolor="#C0C0C0">
<br>
<h2>Regression Testing v7</h2>
<s:form action="Dispatch_configure" tooltipConfig="%{'jsTooltipEnabled':'true'}" method="post">
<s:select
tooltip="Select the schema for the baseline"
label="Baseline Schema"
list="getSchemas()"
name="BaselineDb"
emptyOption="false"
headerKey="None"
headerValue="None"/>
<s:select
tooltip="Select the schema for the project"
label="Project Schema"
list="getSchemas()"
name="ProjectDb"
emptyOption="false"
headerKey="None"
headerValue="None"/>
<s:textarea
label="Compare Tables"
name="CompareTables"
cols="50" rows="20"
tooltip="(Cut and paste the list of tables with differences into this text box) eg:-
annnuity
contracted_benefit
contact
..."
value="%{getInputTables()}"/>
<s

roperty value="getButton()" />
<s:submit action="Dispatch_configure" value="Configure"/>
<s:submit action="Dispatch_submit" value="Submit"/>
<s:submit action="Dispatch_cancel" value="Cancel"/>
</s:form>
</body>
</html>
----------------------------------------------------------
package net.uaps.regression;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;
import java.util.Date;
import java.util.*;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.*;
import java.math.*;
import net.uaps.database.*;
public class Regression extends ActionSupport
{
static Connection con = null;
HashMap<
String, String> optionListMap = new HashMap<String, String>();
HashMap<String, String> schemaListMap = new HashMap<String, String>();
String output;
String input;
public String execute() throws Exception
{
setSchemas();
input = ServletActionContext.getRequest().getParameter("config_submit_button");
return SUCCESS;
}//end execute
public void setSchemas() throws Exception
{
Connection con = DbConnection.getOracleJDBCConnection();
// Create a statement
Statement stmt = con.createStatement();
String query = "select * from database_schemas";
ResultSet rset = stmt.executeQuery(query);
// Dump the result
while (rset.next())
{
schemaListMap.put(rset.getString(1), rset.getString(2));
}
}
public HashMap getSchemas()
{
return schemaListMap;
}
public String getSchemas2()
{
return output;
}
//public HashMap getSchemas()
public String getButton()
{
//return schemaListMap;
return input;
}
}
----------------------------------------------------------
Dispatch.java --------------------------------------------
package net.uaps.regression;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.dispatcher.*;
import java.util.*;
public class Dispatch extends ActionSupport
{
String projectDb;
String baselineDb;
String compareTables;
//Method called when the Configure button pressed.
public String configure() throws Exception
{
System.out.println("In configure");
setBaselineDb(ServletActionContext.getRequest().getParameter("BaselineDb"));
setProjectDb(ServletActionContext.getRequest().getParameter("ProjectDb"));
setCompareTables(ServletActionContext.getRequest().getParameter("CompareTables"));
return "configure";
}
//Method called when the Submit button pressed.
public String submit() throws Exception
{
System.out.println("In submit");
return "submit";
}
//Method called when the Cancel button pressed.
public String cancel() throws Exception
{
System.out.println("In cancel");
return "cancel";
}
public void setBaselineDb(String baselineDb)
{
this.baselineDb = baselineDb;
}
public void setProjectDb(String projectDb)
{
this.projectDb = projectDb;
}
public void setCompareTables(String compareTables)
{
this.compareTables = compareTables;
}
public String getBaselineDb()
{
return this.baselineDb;
}
public String getProjectDb()
{
return this.projectDb;
}
public String getCompareTables()
{
return this.compareTables;
}
}
----------------------------------------------------------
RegressionConfigure.jsp ----------------------------------
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Regression Testing Configuration</title>
</head>
<body bgcolor="#C0C0C0">
<br>
<h2>Regression Testing Configuration</h2>
<s:form action="Regression" tooltipConfig="%{'jsTooltipEnabled':'true'}" method="post">
<s

roperty value="getBaselineDb()" />
<s

roperty value="getInputTables()" />
<!--
<s:label key="{getInputTables()}" />
<s:label key="{getBaselineDb()}" />
-->
<s:submit name="config_submit_button" value="Submit" />
<s:submit value="%{'Cancel'}" />
</s:form>
</body>
</html>
----------------------------------------------------------
RegressionConfigure.java ---------------------------------
package net.uaps.regression;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;
import java.util.Date;
import java.util.*;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.*;
import java.math.*;
import net.uaps.database.*;
public class RegressionConfigure extends ActionSupport
{
static Connection con = null;
HashMap<String, String> schemaListMap = new HashMap<String, String>();
String baselineDb;
String projectDb;
String inputTables;
public String execute() throws Exception
{
baselineDb = ServletActionContext.getRequest().getParameter("BaselineDb");
projectDb = ServletActionContext.getRequest().getParameter("ProjectDb");
inputTables = ServletActionContext.getRequest().getParameter("CompareTables");
//System.out.print("MATT inputTables = " + inputTables);
//getConfigurationDetails();
//ServletActionContext.setResponse().getParameter("configure_button");
return SUCCESS;
}//end execute
public void getConfigurationDetails() throws Exception
{
//Read the REGRESSION_TEST_RULES table from the baseline database and display its contents
//in a datagrid for editing.
Connection con = DbConnection.getOracleJDBCConnection();
// Create a statement
Statement stmt = con.createStatement();
String query = "select * from database_schemas";
ResultSet rset = stmt.executeQuery(query);
// Dump the result
while (rset.next())
{
schemaListMap.put(rset.getString(1), rset.getString(2));
}
}
//public HashMap getSchemas()
public String getBaselineDb()
{
//return schemaListMap;
return baselineDb;
}
//public HashMap getSchemas()
public String getProjectDb()
{
//return schemaListMap;
return projectDb;
}
//public HashMap getSchemas()
public String getInputTables()
{
//return schemaListMap;
return inputTables;
}
}
----------------------------------------------------------