You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by zo...@apache.org on 2011/02/27 19:28:41 UTC

svn commit: r1075106 [9/18] - in /aries/tags/samples-0.1-incubating: ./ ariestrader/ ariestrader/assemblies/ ariestrader/assemblies/ariestrader-all-eba/ ariestrader/assemblies/ariestrader-jdbc-eba/ ariestrader/assemblies/equinox-test-harness/ ariestrad...

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2JNDI.java
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2JNDI.java?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2JNDI.java (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2JNDI.java Sun Feb 27 18:28:26 2011
@@ -0,0 +1,104 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.aries.samples.ariestrader.web.prims;
+
+import java.io.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+import javax.sql.DataSource;
+import org.apache.aries.samples.ariestrader.util.*;
+
+/**
+ * 
+ * PingServlet2JNDI performs a basic JNDI lookup of a JDBC DataSource
+ * 
+ */
+
+public class PingServlet2JNDI extends HttpServlet
+{
+
+	private static String initTime;
+	private static int hitCount;
+	
+	/**
+	 * forwards post requests to the doGet method
+	 * Creation date: (11/6/2000 10:52:39 AM)
+	 * @param res javax.servlet.http.HttpServletRequest
+	 * @param res2 javax.servlet.http.HttpServletResponse
+	 */
+	public void doPost(HttpServletRequest req, HttpServletResponse res)
+		throws ServletException, IOException
+	{
+		doGet(req, res);
+	}
+	/**
+	* this is the main method of the servlet that will service all get requests.
+	* @param request HttpServletRequest
+	* @param responce HttpServletResponce
+	**/
+	public void doGet(HttpServletRequest req, HttpServletResponse res)
+		throws ServletException, IOException
+	{
+		res.setContentType("text/html");
+		java.io.PrintWriter out = res.getWriter();
+
+		StringBuffer output = new StringBuffer(100);
+
+		try
+			{
+
+			int iter = TradeConfig.getPrimIterations();
+			for (int ii = 0; ii < iter; ii++) {
+                            DataSource dataSource = (DataSource) ServiceUtilities.getOSGIService(DataSource.class.getName(),TradeConfig.OSGI_DS_NAME_FILTER);
+			}			
+
+
+			output.append(
+				"<html><head><title>Ping JNDI -- lookup of JDBC DataSource</title></head>"
+					+ "<body><HR><FONT size=\"+2\" color=\"#000066\">Ping JNDI -- lookup of JDBC DataSource</FONT><HR><FONT size=\"-1\" color=\"#000066\">Init time : "
+					+ initTime);
+			hitCount++;
+			output.append("</FONT><BR>Hit Count: " + hitCount);
+			output.append("<HR></body></html>");
+			out.println(output.toString());
+		}
+		catch (Exception e)
+		{
+			Log.error(e, "PingServlet2JNDI -- error look up of a JDBC DataSource");
+			res.sendError(500, "PingServlet2JNDI Exception caught: " + e.toString());
+		}
+
+	}
+	/** 
+	 * returns a string of information about the servlet
+	 * @return info String: contains info about the servlet
+	 **/
+	public String getServletInfo()
+	{
+		return "Basic JNDI look up of a JDBC DataSource";
+	}
+	/**
+	* called when the class is loaded to initialize the servlet
+	* @param config ServletConfig:
+	**/
+	public void init(ServletConfig config) throws ServletException
+	{
+		super.init(config);
+		hitCount = 0;
+		initTime = new java.util.Date().toString();
+	}
+}
\ No newline at end of file

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2Jsp.java
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2Jsp.java?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2Jsp.java (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2Jsp.java Sun Feb 27 18:28:26 2011
@@ -0,0 +1,74 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.aries.samples.ariestrader.web.prims;
+
+import java.io.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import org.apache.aries.samples.ariestrader.util.*;
+
+
+/**
+ *
+ * PingServlet2JSP tests a call from a servlet to a JavaServer Page providing server-side dynamic
+ * HTML through JSP scripting.
+ *
+ */
+public class PingServlet2Jsp extends HttpServlet {
+	private static int hitCount = 0;
+
+/**
+ * forwards post requests to the doGet method
+ * Creation date: (11/6/2000 10:52:39 AM)
+ * @param res javax.servlet.http.HttpServletRequest
+ * @param res2 javax.servlet.http.HttpServletResponse
+ */
+public void doPost(HttpServletRequest req, HttpServletResponse res)
+	throws ServletException, IOException {
+	doGet(req, res);
+}
+	
+/**
+* this is the main method of the servlet that will service all get requests.
+* @param request HttpServletRequest
+* @param responce HttpServletResponce
+**/
+public void doGet(HttpServletRequest req, HttpServletResponse res)
+	throws ServletException, IOException {
+	PingBean ab;
+	try
+	{
+		ab = new PingBean();
+                hitCount++;
+		ab.setMsg("Hit Count: " + hitCount);
+		req.setAttribute("ab", ab);
+		
+		getServletConfig().getServletContext().getRequestDispatcher("/PingServlet2Jsp.jsp").forward(req, res);
+	}
+	catch (Exception ex)
+	{
+		Log.error(
+			ex,"PingServlet2Jsp.doGet(...): request error"); 
+		res.sendError(
+			500, 
+			"PingServlet2Jsp.doGet(...): request error"
+				+ ex.toString()); 
+
+	}
+}
+}
\ No newline at end of file

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2Servlet.java
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2Servlet.java?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2Servlet.java (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2Servlet.java Sun Feb 27 18:28:26 2011
@@ -0,0 +1,74 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.aries.samples.ariestrader.web.prims;
+
+import java.io.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import org.apache.aries.samples.ariestrader.util.*;
+
+
+/**
+ *
+ * PingServlet2Servlet tests servlet to servlet request dispatching. Servlet 1,
+ * the controller, creates a new JavaBean object forwards the servlet request with
+ * the JavaBean added to Servlet 2. Servlet 2 obtains access to the JavaBean through
+ * the Servlet request object and provides the dynamic HTML output based on the JavaBean
+ * data.
+ * PingServlet2Servlet is the initial servlet that sends a request to {@link PingServlet2ServletRcv}
+ *
+ */
+public class PingServlet2Servlet extends HttpServlet {
+	private static int hitCount = 0;
+
+/**
+ * forwards post requests to the doGet method
+ * Creation date: (11/6/2000 10:52:39 AM)
+ * @param res javax.servlet.http.HttpServletRequest
+ * @param res2 javax.servlet.http.HttpServletResponse
+ */
+public void doPost(HttpServletRequest req, HttpServletResponse res)
+	throws ServletException, IOException {
+	doGet(req, res);
+}
+/**
+* this is the main method of the servlet that will service all get requests.
+* @param request HttpServletRequest
+* @param responce HttpServletResponce
+**/
+public void doGet(HttpServletRequest req, HttpServletResponse res)
+	throws ServletException, IOException {
+	PingBean ab;
+	try
+	{
+		ab = new PingBean();
+		hitCount++;
+		ab.setMsg("Hit Count: " + hitCount);
+		req.setAttribute("ab", ab);
+		
+		getServletConfig().getServletContext().getRequestDispatcher("/servlet/PingServlet2ServletRcv").forward(req, res);
+	}
+	catch (Exception ex)
+	{
+		Log.error(
+			ex,	"PingServlet2Servlet.doGet(...): general exception"); 
+		res.sendError(500, "PingServlet2Servlet.doGet(...): general exception" + ex.toString()); 
+
+	}
+}   
+}
\ No newline at end of file

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2ServletRcv.java
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2ServletRcv.java?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2ServletRcv.java (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServlet2ServletRcv.java Sun Feb 27 18:28:26 2011
@@ -0,0 +1,91 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.aries.samples.ariestrader.web.prims;
+
+import java.io.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import org.apache.aries.samples.ariestrader.util.*;
+
+
+/**
+ *
+ * PingServlet2Servlet tests servlet to servlet request dispatching. Servlet 1,
+ * the controller, creates a new JavaBean object forwards the servlet request with
+ * the JavaBean added to Servlet 2. Servlet 2 obtains access to the JavaBean through
+ * the Servlet request object and provides the dynamic HTML output based on the JavaBean
+ * data.
+ * PingServlet2ServletRcv receives a request from {@link PingServlet2Servlet} and displays output.
+ *
+ */
+public class PingServlet2ServletRcv extends HttpServlet {
+	private static String initTime = null;
+
+/**
+ * forwards post requests to the doGet method
+ * Creation date: (11/6/2000 10:52:39 AM)
+ * @param res javax.servlet.http.HttpServletRequest
+ * @param res2 javax.servlet.http.HttpServletResponse
+ */
+public void doPost(HttpServletRequest req, HttpServletResponse res)
+	throws ServletException, IOException {
+	doGet(req, res);
+}
+	
+	
+/**
+* this is the main method of the servlet that will service all get requests.
+* @param request HttpServletRequest
+* @param responce HttpServletResponce
+**/
+public void doGet(HttpServletRequest req, HttpServletResponse res)
+	throws ServletException, IOException {
+	PingBean ab;
+	try
+	{
+		ab = (PingBean) req.getAttribute("ab");
+		res.setContentType("text/html");
+		PrintWriter out = res.getWriter();
+		out.println(
+			"<html><head><title>Ping Servlet2Servlet</title></head>"
+				+ "<body><HR><BR><FONT size=\"+2\" color=\"#000066\">PingServlet2Servlet:<BR></FONT><FONT size=\"+1\" color=\"#000066\">Init time: "
+				+ initTime
+				+ "</FONT><BR><BR><B>Message from Servlet: </B>"
+				+ ab.getMsg()
+				+ "</body></html>"); 
+	}
+	catch (Exception ex)
+	{
+		Log.error(ex, "PingServlet2ServletRcv.doGet(...): general exception"); 
+		res.sendError(
+			500, 
+			"PingServlet2ServletRcv.doGet(...): general exception"
+				+ ex.toString()); 
+	}
+
+}
+/**
+* called when the class is loaded to initialize the servlet
+* @param config ServletConfig:
+**/
+public void init(ServletConfig config) throws ServletException {
+	super.init(config);
+	initTime = new java.util.Date().toString();
+
+}
+}
\ No newline at end of file

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServletWriter.java
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServletWriter.java?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServletWriter.java (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingServletWriter.java Sun Feb 27 18:28:26 2011
@@ -0,0 +1,96 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.aries.samples.ariestrader.web.prims;
+
+import java.io.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import org.apache.aries.samples.ariestrader.util.*;
+
+
+/**
+ *
+ * PingServlet extends PingServlet by using a PrintWriter for formatted 
+ * output vs. the output stream used by {@link PingServlet}.
+ * 
+ */
+public class PingServletWriter extends HttpServlet {
+
+	private static String initTime;
+	private static int hitCount;
+
+	/**
+	 * forwards post requests to the doGet method
+	 * Creation date: (11/6/2000 10:52:39 AM)
+	 * @param res javax.servlet.http.HttpServletRequest
+	 * @param res2 javax.servlet.http.HttpServletResponse
+	 */
+	public void doPost(HttpServletRequest req, HttpServletResponse res)
+		throws ServletException, IOException {
+		doGet(req, res);
+	}
+	/**
+	* this is the main method of the servlet that will service all get requests.
+	* @param request HttpServletRequest
+	* @param responce HttpServletResponce
+	**/
+	public void doGet(HttpServletRequest req, HttpServletResponse res)
+		throws ServletException, IOException {
+		try
+		{
+			res.setContentType("text/html");
+
+			// The following 2 lines are the difference between PingServlet and PingServletWriter
+			//   the latter uses a PrintWriter for output versus a binary output stream.
+			//ServletOutputStream out = res.getOutputStream();
+			java.io.PrintWriter out = res.getWriter();
+                        hitCount++;
+			out.println(
+				"<html><head><title>Ping Servlet Writer</title></head>"
+					+ "<body><HR><BR><FONT size=\"+2\" color=\"#000066\">Ping Servlet Writer:<BR></FONT><FONT size=\"+1\" color=\"#000066\">Init time : "
+					+ initTime
+					+ "<BR><BR></FONT>  <B>Hit Count: "
+					+ hitCount
+					+ "</B></body></html>"); 
+		}
+		catch (Exception e)
+		{
+			Log.error(e, "PingServletWriter.doGet(...): general exception caught"); 
+			res.sendError(500, e.toString());
+		}
+	}
+	/** 
+	 * returns a string of information about the servlet
+	 * @return info String: contains info about the servlet
+	 **/
+
+	public String getServletInfo()
+	{
+		return "Basic dynamic HTML generation through a servlet using a PrintWriter";
+	}
+	/**
+	* called when the class is loaded to initialize the servlet
+	* @param config ServletConfig:
+	**/
+	public void init(ServletConfig config) throws ServletException {
+		super.init(config);
+		hitCount = 0;
+		initTime = new java.util.Date().toString();
+
+	}
+}
\ No newline at end of file

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession1.java
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession1.java?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession1.java (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession1.java Sun Feb 27 18:28:26 2011
@@ -0,0 +1,126 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.aries.samples.ariestrader.web.prims;
+
+import java.io.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import org.apache.aries.samples.ariestrader.util.*;
+
+/**
+ *
+ * PingHTTPSession1 - SessionID tests fundamental HTTP session functionality 
+ * by creating a unique session ID for each individual user. The ID is stored 
+ * in the users session and is accessed and displayed on each user request.
+ *
+ */
+public class PingSession1 extends HttpServlet {
+	private static int count;
+	// For each new session created, add a session ID of the form "sessionID:" + count
+	private static String initTime;
+	private static int hitCount;
+/**
+ * forwards post requests to the doGet method
+ * Creation date: (11/6/2000 10:52:39 AM)
+ * @param res javax.servlet.http.HttpServletRequest
+ * @param res2 javax.servlet.http.HttpServletResponse
+ */
+public void doPost(HttpServletRequest req, HttpServletResponse res)
+	throws ServletException, IOException {
+	doGet(req, res);
+}
+/**
+* this is the main method of the servlet that will service all get requests.
+* @param request HttpServletRequest
+* @param responce HttpServletResponce
+**/
+public void doGet(HttpServletRequest request, HttpServletResponse response)
+	throws ServletException, IOException {
+	HttpSession session = null;
+	try
+	{
+		try
+		{
+			//get the users session, if the user does not have a session create one.
+			session = request.getSession(true);
+		}
+		catch (Exception e)
+		{
+			Log.error(e, "PingSession1.doGet(...): error getting session"); 
+			//rethrow the exception for handling in one place.
+			throw e;
+		}
+
+		// Get the session data value
+		Integer ival = (Integer) session.getAttribute("sessiontest.counter");
+		//if their is not a counter create one.
+		if (ival == null)
+		{
+			ival = new Integer(count++);
+			session.setAttribute("sessiontest.counter", ival);
+		}
+		String SessionID = "SessionID:" + ival.toString();
+
+		// Output the page
+		response.setContentType("text/html");
+		response.setHeader("SessionKeyTest-SessionID", SessionID);
+
+		PrintWriter out = response.getWriter();
+		out.println(
+			"<html><head><title>HTTP Session Key Test</title></head><body><HR><BR><FONT size=\"+2\" color=\"#000066\">HTTP Session Test 1: Session Key<BR></FONT><FONT size=\"+1\" color=\"#000066\">Init time: "
+				+ initTime
+				+ "</FONT><BR><BR>");
+                hitCount++;
+		out.println(
+			"<B>Hit Count: "
+				+ hitCount
+				+ "<BR>Your HTTP Session key is "
+				+ SessionID
+				+ "</B></body></html>"); 
+	}
+	catch (Exception e)
+	{
+		//log the exception
+		Log.error(e, "PingSession1.doGet(..l.): error."); 
+		//set the server response to 500 and forward to the web app defined error page 
+		response.sendError(
+			500, 
+			"PingSession1.doGet(...): error. " + e.toString()); 
+	}
+}
+/** 
+ * returns a string of information about the servlet
+ * @return info String: contains info about the servlet
+ **/
+
+public String getServletInfo()
+{
+	return "HTTP Session Key: Tests management of a read only unique id";
+}
+/**
+* called when the class is loaded to initialize the servlet
+* @param config ServletConfig:
+**/
+public void init(ServletConfig config) throws ServletException {
+	super.init(config);
+	count = 0;
+	hitCount = 0;
+	initTime = new java.util.Date().toString();
+
+}
+}
\ No newline at end of file

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession2.java
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession2.java?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession2.java (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession2.java Sun Feb 27 18:28:26 2011
@@ -0,0 +1,143 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.aries.samples.ariestrader.web.prims;
+
+import java.io.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import org.apache.aries.samples.ariestrader.util.*;
+
+/**
+ *
+ * PingHTTPSession2 session create/destroy further extends the previous test by
+ * invalidating the HTTP Session on every 5th user access. This results in testing
+ * HTTPSession create and destroy
+ *
+ */
+public class PingSession2 extends HttpServlet {
+
+	private static String initTime;
+	private static int hitCount;
+
+/**
+ * forwards post requests to the doGet method
+ * Creation date: (11/6/2000 10:52:39 AM)
+ * @param res javax.servlet.http.HttpServletRequest
+ * @param res2 javax.servlet.http.HttpServletResponse
+ */
+public void doPost(HttpServletRequest req, HttpServletResponse res)
+	throws ServletException, IOException {
+	doGet(req, res);
+}
+/**
+* this is the main method of the servlet that will service all get requests.
+* @param request HttpServletRequest
+* @param responce HttpServletResponce
+**/
+public void doGet(HttpServletRequest request, HttpServletResponse response)
+	throws ServletException, IOException {
+	HttpSession session = null;
+	try
+	{
+		try
+		{
+			session = request.getSession(true);
+		}
+		catch (Exception e)
+		{
+			Log.error(e, "PingSession2.doGet(...): error getting session"); 
+			//rethrow the exception for handling in one place.
+			throw e;
+
+		}
+
+		// Get the session data value
+		Integer ival = (Integer) session.getAttribute("sessiontest.counter");
+		//if there is not a counter then create one.
+		if (ival == null)
+		{
+			ival = new Integer(1);
+		}
+		else
+		{
+			ival = new Integer(ival.intValue() + 1);
+		}
+		session.setAttribute("sessiontest.counter", ival);
+		//if the session count is equal to five invalidate the session
+		if (ival.intValue() == 5)
+		{
+			session.invalidate();
+		}
+
+		try
+		{
+			// Output the page
+			response.setContentType("text/html");
+			response.setHeader("SessionTrackingTest-counter", ival.toString());
+
+			PrintWriter out = response.getWriter();
+			out.println(
+				"<html><head><title>Session Tracking Test 2</title></head><body><HR><BR><FONT size=\"+2\" color=\"#000066\">HTTP Session Test 2: Session create/invalidate <BR></FONT><FONT size=\"+1\" color=\"#000066\">Init time: "
+					+ initTime
+					+ "</FONT><BR><BR>");
+                        hitCount++;
+			out.println(
+				"<B>Hit Count: "
+					+ hitCount
+					+ "<BR>Session hits: "
+					+ ival
+					+ "</B></body></html>"); 
+		}
+		catch (Exception e)
+		{
+			Log.error(e, "PingSession2.doGet(...): error getting session information"); 
+			//rethrow the exception for handling in one place.
+			throw e;
+		}
+
+	}
+
+	catch (Exception e)
+	{
+		//log the exception
+		Log.error(e, "PingSession2.doGet(...): error."); 
+		//set the server response to 500 and forward to the web app defined error page 
+		response.sendError(
+			500, 
+			"PingSession2.doGet(...): error. " + e.toString()); 
+	}
+} //end of the method
+/** 
+ * returns a string of information about the servlet
+ * @return info String: contains info about the servlet
+ **/
+public String getServletInfo()
+{
+	return "HTTP Session Key: Tests management of a read/write unique id";
+}
+/**
+* called when the class is loaded to initialize the servlet
+* @param config ServletConfig:
+**/
+public void init(ServletConfig config) throws ServletException {
+	super.init(config);
+	hitCount = 0;
+	initTime = new java.util.Date().toString();
+
+}
+}
\ No newline at end of file

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession3.java
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession3.java?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession3.java (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession3.java Sun Feb 27 18:28:26 2011
@@ -0,0 +1,175 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.aries.samples.ariestrader.web.prims;
+
+import java.io.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import org.apache.aries.samples.ariestrader.util.*;
+
+/**
+ * 
+ * PingHTTPSession3 tests the servers ability to manage 
+ * and persist large HTTPSession data objects. The servlet creates the large custom 
+ * java object {@link PingSession3Object}. This large session object is 
+ * retrieved and stored to the session on each user request.  The default settings
+ * result in approx 2024 bits being retrieved and stored upon each request.
+ *
+ */
+public class PingSession3 extends HttpServlet {
+	private static int NUM_OBJECTS = 2;
+	private static String initTime = null;
+	private static int hitCount = 0;
+
+/**
+ * forwards post requests to the doGet method
+ * Creation date: (11/6/2000 10:52:39 AM)
+ * @param res javax.servlet.http.HttpServletRequest
+ * @param res2 javax.servlet.http.HttpServletResponse
+ */
+public void doPost(HttpServletRequest req, HttpServletResponse res)
+	throws ServletException, IOException {
+	doGet(req, res);
+}
+/**
+* this is the main method of the servlet that will service all get requests.
+* @param request HttpServletRequest
+* @param responce HttpServletResponce
+**/
+public void doGet(HttpServletRequest request, HttpServletResponse response)
+	throws ServletException, IOException {
+
+	PrintWriter out = response.getWriter();
+	//Using a StringBuffer to output all at once.
+	StringBuffer outputBuffer = new StringBuffer();
+	HttpSession session = null;
+	PingSession3Object[] sessionData;
+	response.setContentType("text/html");
+
+	//this is a general try/catch block.  The catch block at the end of this will forward the responce
+	//to an error page if there is an exception
+	try
+	{
+
+		try
+		{
+			session = request.getSession(true);
+		}
+		catch (Exception e)
+		{
+			Log.error(e, "PingSession3.doGet(...): error getting session"); 
+			//rethrow the exception for handling in one place.
+			throw e;
+
+		}
+		// Each PingSession3Object in the PingSession3Object array is 1K in size
+		// NUM_OBJECTS sets the size of the array to allocate and thus set the size in KBytes of the session object
+		// NUM_OBJECTS can be initialized by the servlet
+		// Here we check for the request parameter to change the size and invalidate the session if it exists
+		// NOTE: Current user sessions will remain the same (i.e. when NUM_OBJECTS is changed, all user thread must be restarted
+		// for the change to fully take effect
+
+		String num_objects;
+		if ((num_objects = request.getParameter("num_objects")) != null)
+		{
+			//validate input
+			try
+			{
+				int x = Integer.parseInt(num_objects);
+				if (x > 0)
+				{
+					NUM_OBJECTS = x;
+				}
+			}
+			catch (Exception e)
+			{
+				Log.error(e, "PingSession3.doGet(...): input should be an integer, input=" + num_objects); 
+			} //  revert to current value on exception
+
+			outputBuffer.append(
+				"<html><head> Session object size set to "
+					+ NUM_OBJECTS
+					+ "K bytes </head><body></body></html>"); 
+			if (session != null)
+				session.invalidate();
+			out.print(outputBuffer.toString());
+			out.close();
+			return;
+		}
+
+		// Get the session data value
+		sessionData = 
+			(PingSession3Object[]) session.getAttribute("sessiontest.sessionData"); 
+		if (sessionData == null)
+		{
+			sessionData = new PingSession3Object[NUM_OBJECTS];
+			for (int i = 0; i < NUM_OBJECTS; i++)
+			{
+				sessionData[i] = new PingSession3Object();
+			}
+		}
+
+		session.setAttribute("sessiontest.sessionData", sessionData);
+
+		//Each PingSession3Object is about 1024 bits, there are 8 bits in a byte.
+		int num_bytes = (NUM_OBJECTS*1024)/8;
+		response.setHeader(
+			"SessionTrackingTest-largeSessionData", 
+			num_bytes + "bytes"); 
+
+		outputBuffer
+			.append("<html><head><title>Session Large Data Test</title></head><body><HR><BR><FONT size=\"+2\" color=\"#000066\">HTTP Session Test 3: Large Data<BR></FONT><FONT size=\"+1\" color=\"#000066\">Init time: ")
+			.append(initTime)
+			.append("</FONT><BR><BR>");
+                hitCount++;
+		outputBuffer.append("<B>Hit Count: ").append(hitCount).append(
+			"<BR>Session object updated. Session Object size = "
+				+ num_bytes
+				+ " bytes </B></body></html>"); 
+		//output the Buffer to the printWriter.
+		out.println(outputBuffer.toString());
+
+	}
+	catch (Exception e)
+	{
+		//log the exception
+		Log.error(e, "PingSession3.doGet(..l.): error."); 
+		//set the server response to 500 and forward to the web app defined error page 
+		response.sendError(
+			500, 
+			"PingSession3.doGet(...): error. " + e.toString()); 	}
+}
+/** 
+ * returns a string of information about the servlet
+ * @return info String: contains info about the servlet
+ **/
+public String getServletInfo()
+{
+	return "HTTP Session Object: Tests management of a large custom session class";
+}    
+/**
+* called when the class is loaded to initialize the servlet
+* @param config ServletConfig:
+**/
+public void init(ServletConfig config) throws ServletException {
+	super.init(config);
+	hitCount = 0;
+	initTime = new java.util.Date().toString();
+
+}
+}
\ No newline at end of file

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession3Object.java
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession3Object.java?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession3Object.java (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingSession3Object.java Sun Feb 27 18:28:26 2011
@@ -0,0 +1,87 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.aries.samples.ariestrader.web.prims;
+
+import java.io.*;
+
+/**
+ * 
+ * An object that contains approximately 1024 bits of information.  This is used by
+ * {@link PingSession3}
+ *
+ */
+public class PingSession3Object implements Serializable {
+	// PingSession3Object represents a BLOB of session data of various. 
+	// Each instantiation of this class is approximately 1K in size (not including overhead for arrays and Strings)
+	// Using different datatype exercises the various serialization algorithms for each type
+
+	byte[] byteVal = new byte[16]; // 8 * 16 = 128 bits
+	char[] charVal = new char[8]; // 16 * 8 = 128 bits
+	int a, b, c, d; // 4 * 32 = 128 bits
+	float e, f, g, h; // 4 * 32 = 128 bits
+	double i, j; // 2 * 64 = 128 bits
+	// Primitive type size = ~5*128=   640
+
+	String s1 = new String("123456789012");	 
+	String s2 = new String("abcdefghijkl");
+
+
+//	 The Session blob must be filled with data to avoid compression of the blob during serialization
+	PingSession3Object()
+	{
+		int index;
+		byte b = 0x8;
+		for (index=0; index<16; index++)
+		{
+			byteVal[index] = (byte) (b+2);
+		}
+
+		char c = 'a';
+		for (index=0; index<8; index++)
+		{
+			charVal[index] = (char) (c+2);
+		}
+
+		a=1; b=2; c=3; d=5;
+		e = (float)7.0; f=(float)11.0; g=(float)13.0; h=(float)17.0;
+		i=(double)19.0; j=(double)23.0;
+	}
+/**
+ * Main method to test the serialization of the Session Data blob object
+ * Creation date: (4/3/2000 3:07:34 PM)
+ * @param args java.lang.String[]
+ */
+
+/** Since the following main method were written for testing purpose, we comment them out
+*public static void main(String[] args) {
+*	try {
+*		PingSession3Object data = new PingSession3Object();
+*
+*		FileOutputStream ostream = new FileOutputStream("c:\\temp\\datablob.xxx");
+*		ObjectOutputStream p = new ObjectOutputStream(ostream);
+*		p.writeObject(data);
+*		p.flush();
+*		ostream.close();
+*	}
+*	catch (Exception e)
+*	{
+*		System.out.println("Exception: " + e.toString());
+*	}
+*}
+*/
+
+}
\ No newline at end of file

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingHtml.html
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingHtml.html?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingHtml.html (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingHtml.html Sun Feb 27 18:28:26 2011
@@ -0,0 +1,26 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<HTML>
+<HEAD>
+<TITLE>PingHTML.html</TITLE>
+</HEAD>
+<BODY>
+<HR>
+<P><FONT size="+2" color="#000066">PING HTML:</FONT></P>
+<P><FONT size="+1" color="#000066">Hello World</FONT></P>
+</BODY>
+</HTML>

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingJsp.jsp
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingJsp.jsp?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingJsp.jsp (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingJsp.jsp Sun Feb 27 18:28:26 2011
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<html>
+<head>
+<META HTTP-EQUIV="pragma" CONTENT="no-cache">
+<META http-equiv="Content-Style-Type" content="text/css">
+<!-- Don't cache on netscape! -->
+<title>PingJsp</title>
+</head>
+<body>
+<%! int hitCount = 0;
+    String initTime = new java.util.Date().toString();
+ %>
+<HR>
+<BR>
+<FONT size="+2" color="#000066">PING JSP:<BR>
+</FONT><FONT size="+1" color="#000066">Init time: <%= initTime %></FONT>
+<% hitCount++; %>
+<P><B>Hit Count: <%= hitCount %></B></P>
+</body>
+</html>

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingJspEL.jsp
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingJspEL.jsp?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingJspEL.jsp (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingJspEL.jsp Sun Feb 27 18:28:26 2011
@@ -0,0 +1,144 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<html>
+<head>
+	<title>PingJspEL</title>
+</head>
+<body>
+<%@ page import="org.apache.aries.samples.ariestrader.util.*,org.apache.aries.samples.ariestrader.api.*,org.apache.aries.samples.ariestrader.api.persistence.*" session="false" %>
+
+<%!
+    int hitCount = 0;
+    String initTime = new java.util.Date().toString();
+    TradeServicesManager tradeServicesManager = null;
+%>
+ 
+<%
+    // setup some variables to work with later
+    int someint1 = TradeConfig.rndInt(100) + 1;
+    pageContext.setAttribute("someint1", new Integer(someint1));
+    int someint2 = TradeConfig.rndInt(100) + 1;
+    pageContext.setAttribute("someint2", new Integer(someint2));
+    float somefloat1 = TradeConfig.rndFloat(100) + 1.0f;
+    pageContext.setAttribute("somefloat1", new Float(somefloat1));
+    float somefloat2 = TradeConfig.rndFloat(100) + 1.0f;
+    pageContext.setAttribute("somefloat2", new Float(somefloat2));
+
+    if (tradeServicesManager == null) {
+        tradeServicesManager = TradeServiceUtilities.getTradeServicesManager();
+    }
+    TradeServices tradeServices = tradeServicesManager.getTradeServices();
+
+    QuoteDataBean quoteData0=null, quoteData1=null, quoteData2=null, quoteData3=null;
+
+    try { 
+    	quoteData0 = tradeServices.getQuote(TradeConfig.rndSymbol());
+    	quoteData1 = tradeServices.getQuote(TradeConfig.rndSymbol());
+    	quoteData2 = tradeServices.getQuote(TradeConfig.rndSymbol());
+    	quoteData3 = tradeServices.getQuote(TradeConfig.rndSymbol());
+    }
+    catch (Exception e)
+    {
+        Log.error("PingJspEL.jsp  exception", e);
+    }
+
+    pageContext.setAttribute("quoteData0", quoteData0);
+    pageContext.setAttribute("quoteData1", quoteData1);
+    pageContext.setAttribute("quoteData2", quoteData2);
+    pageContext.setAttribute("quoteData3", quoteData3);
+
+    QuoteDataBean quoteData[] = new QuoteDataBean[4];
+    quoteData[0] = quoteData0;
+    quoteData[1] = quoteData1;
+    quoteData[2] = quoteData2;
+    quoteData[3] = quoteData3;
+
+    pageContext.setAttribute("quoteData", quoteData);
+%>
+  
+<HR>
+<BR>
+  <FONT size="+2" color="#000066">PING JSP EL:<BR></FONT><FONT size="+1" color="#000066">Init time: <%= initTime %></FONT>
+  <P>
+    <B>Hit Count: <%= hitCount++ %></B>
+   </P>
+<HR>
+
+<P>
+
+someint1 = <%= someint1 %><br/>
+someint2 = <%= someint2 %><br/>
+somefloat1 = <%= somefloat1 %><br/>
+somefloat2 = <%= somefloat2 %><br/>
+
+<P>
+
+<HR>
+
+<table border="1">
+	<thead>
+		<th>EL Type</th>
+		<th>EL Expressions</th>
+		<th>Result</th>
+	</thead>
+	<tr>
+		<td>Integer Arithmetic</td>
+		<td>\${someint1 + someint2 - someint1 * someint2 mod someint1}</td>
+		<td>${someint1 + someint2 - someint1 * someint2 mod someint1}</td>
+	</tr>
+	<tr>
+		<td>Floating Point Arithmetic</td>
+		<td>\${somefloat1 + somefloat2 - somefloat1 * somefloat2 / somefloat1}</td>
+		<td>${somefloat1 + somefloat2 - somefloat1 * somefloat2 / somefloat1}</td>
+	</tr>
+	<tr>
+		<td>Logical Operations</td>
+		<td>\${(someint1 < someint2) && (someint1 <= someint2) || (someint1 == someint2) && !Boolean.FALSE}</td>
+		<td>${(someint1 < someint2) && (someint1 <= someint2) || (someint1 == someint2) && !Boolean.FALSE}</td>
+	</tr>
+	<tr>
+		<td>Indexing Operations</td>
+		<td>
+			\${quoteData1.symbol}<br/>
+			\${quoteData[2].symbol}<br/>
+			\${quoteData3["symbol"]}<br/>
+			\${header["host"]}<br/>
+			\${header.host}<br/>
+		</td>
+		<td>
+			${quoteData1.symbol}<br/>
+			${quoteData[2].symbol}<br/>
+			${quoteData3["symbol"]}<br/>
+			${header["host"]}<br/>
+			${header.host}
+		</td>
+	</tr>
+	<tr>
+		<td>Variable Scope Tests</td>
+		<td>
+			\${(quoteData0 == null) ? "null" : quoteData0}<br/>
+			\${(noSuchVariableAtAnyScope == null) ? "null" : noSuchVariableAtAnyScope}
+		</td>
+		<td>
+			${(quoteData0 == null) ? "null" : quoteData0}<br/>
+			${(noSuchVariableAtAnyScope == null) ? "null" : noSuchVariableAtAnyScope}
+		</td>
+	</tr>
+</table>
+</body>
+</html>

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingServlet2Jsp.jsp
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingServlet2Jsp.jsp?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingServlet2Jsp.jsp (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/PingServlet2Jsp.jsp Sun Feb 27 18:28:26 2011
@@ -0,0 +1,37 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<META HTTP-EQUIV="pragma" CONTENT="no-cache">
+<META http-equiv="Content-Style-Type" content="text/css">
+<!-- Don't cache on netscape! -->
+<title>PingJsp</title>
+</head>
+<BODY>
+<%! String initTime = (new java.util.Date()).toString(); 
+ %>
+<jsp:useBean id="ab" type="org.apache.aries.samples.ariestrader.web.prims.PingBean" scope="request" />
+<HR>
+<FONT size="+2" color="#000066"><BR>
+Ping Servlet2JSP:<BR>
+</FONT><FONT size="+1" color="#000066">Init time: <%= initTime %></FONT><BR>
+<BR>
+<B>Message from Servlet: </B> <%= ab.getMsg() %>
+
+</BODY>
+</html>

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/WEB-INF/web.xml?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/WEB-INF/web.xml (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/WEB-INF/web.xml Sun Feb 27 18:28:26 2011
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+    <display-name>AriesTrader Web JDBC</display-name>
+    
+    <filter>
+        <display-name>OrdersAlertFilter</display-name>
+        <filter-name>OrdersAlertFilter</filter-name>
+        <filter-class>org.apache.aries.samples.ariestrader.web.OrdersAlertFilter</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>OrdersAlertFilter</filter-name>
+        <servlet-name>TradeAppServlet</servlet-name>
+    </filter-mapping>
+    
+    <servlet>
+        <display-name>TradeAppServlet</display-name>
+        <servlet-name>TradeAppServlet</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.TradeAppServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    
+    <servlet>
+        <display-name>TradeConfigServlet</display-name>
+        <servlet-name>TradeConfigServlet</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.TradeConfigServlet</servlet-class>
+    </servlet>
+    
+   <servlet>
+        <display-name>TradeScenarioServlet</display-name>
+        <servlet-name>TradeScenarioServlet</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.TradeScenarioServlet</servlet-class>
+        <init-param>
+            <description>Sets the default RuntimeMode. Legal values include Full EJB3, Direct (JDBC), Session (EJB3) To Direct, Web JDBC, and Web JPA</description>
+            <param-name>runTimeMode</param-name>
+            <param-value>Web JDBC</param-value>
+        </init-param>
+        <init-param>
+            <description>Sets the default Order Processing Mode. Legal values include Synchronous and Asynchronous_2-Phase</description>
+            <param-name>orderProcessingMode</param-name>
+            <param-value>Synchronous</param-value>
+        </init-param>
+        <init-param>
+            <description>
+                Sets the protocol the web application communicates with the server side services when driving with TradeScenarioServlet. Legal values incude Standard and WebServices.
+            </description>
+            <param-name>accessMode</param-name>
+            <param-value>Standard</param-value>
+        </init-param>
+        <init-param>
+            <description>Sets the WebServices endpoint when using WebServices accessMode when driving with TradeScenarioServlet.</description>
+            <param-name>webServicesEndpoint</param-name>
+            <param-value>http://localhost:8080/ariestrader/services/TradeWSServices</param-value>
+        </init-param>
+        <init-param>
+            <description>Sets the default workloadMix used with TradeScenario servlet. Legal values include Standard and High-Volume</description>
+            <param-name>workloadMix</param-name>
+            <param-value>Standard</param-value>
+        </init-param>
+        <init-param>
+            <description>Sets the default WebInterface. Legal values include JSP and JSP-images</description>
+            <param-name>WebInterface</param-name>
+            <param-value>JSP</param-value>
+        </init-param>
+        <init-param>
+            <description>Sets the population of Trade users when driving with TradeScenarioServlet.</description>
+            <param-name>maxUsers</param-name>
+            <param-value>200</param-value>
+        </init-param>
+        <init-param>
+            <description>Sets the population of Stock quotes used when driving with TradeScenarioServlet.</description>
+            <param-name>maxQuotes</param-name>
+            <param-value>400</param-value>
+        </init-param>
+        <init-param>
+            <description>Sets the number of iterations on web/ejb primitives.</description>
+            <param-name>primIterations</param-name>
+            <param-value>1</param-value>
+        </init-param>
+        <init-param>
+            <description>Sets the data caching type, which can be DistributedMap, Command Caching and No Caching</description>
+            <param-name>cachingType</param-name>
+            <param-value>No Caching</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    
+    <!-- Web container primitives -->
+    <servlet>
+        <display-name>ExplicitGC</display-name>
+        <servlet-name>ExplicitGC</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.ExplicitGC</servlet-class>
+    </servlet>
+    <servlet>
+        <display-name>PingServlet</display-name>
+        <servlet-name>PingServlet</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.PingServlet</servlet-class>
+    </servlet>
+    <servlet>
+        <display-name>PingServletWriter</display-name>
+        <servlet-name>PingServletWriter</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.PingServletWriter</servlet-class>
+    </servlet>
+    <servlet>
+        <display-name>PingServlet2Servlet</display-name>
+        <servlet-name>PingServlet2Servlet</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.PingServlet2Servlet</servlet-class>
+    </servlet>
+    <servlet>
+        <display-name>PingServlet2ServletRcv</display-name>
+        <servlet-name>PingServlet2ServletRcv</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.PingServlet2ServletRcv</servlet-class>
+    </servlet>
+    <servlet>
+        <display-name>PingServlet2Include</display-name>
+        <servlet-name>PingServlet2Include</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.PingServlet2Include</servlet-class>
+    </servlet>
+    <servlet>
+        <display-name>PingServlet2IncludeRcv</display-name>
+        <servlet-name>PingServlet2IncludeRcv</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.PingServlet2IncludeRcv</servlet-class>
+    </servlet>
+    <servlet>
+        <display-name>PingServlet2Jsp</display-name>
+        <servlet-name>PingServlet2Jsp</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.PingServlet2Jsp</servlet-class>
+    </servlet>
+    <servlet>
+        <display-name>PingSession1</display-name>
+        <servlet-name>PingSession1</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.PingSession1</servlet-class>
+    </servlet>
+    <servlet>
+        <display-name>PingSession2</display-name>
+        <servlet-name>PingSession2</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.PingSession2</servlet-class>
+    </servlet>
+    <servlet>
+        <display-name>PingSession3</display-name>
+        <servlet-name>PingSession3</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.PingSession3</servlet-class>
+    </servlet>
+    <servlet>
+        <display-name>PingJDBCRead</display-name>
+        <servlet-name>PingJDBCRead</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.PingJDBCRead</servlet-class>
+    </servlet>
+    <servlet>
+        <display-name>PingJDBCWrite</display-name>
+        <servlet-name>PingJDBCWrite</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.PingJDBCWrite</servlet-class>
+    </servlet>
+    <servlet>
+        <display-name>PingServlet2JNDI</display-name>
+        <servlet-name>PingServlet2JNDI</servlet-name>
+        <servlet-class>org.apache.aries.samples.ariestrader.web.prims.PingServlet2JNDI</servlet-class>
+    </servlet>
+    <!-- End of Web container primitives -->
+    
+    <servlet-mapping>
+        <servlet-name>TradeAppServlet</servlet-name>
+        <url-pattern>/app</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>TradeConfigServlet</servlet-name>
+        <url-pattern>/config</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>TradeScenarioServlet</servlet-name>
+        <url-pattern>/scenario</url-pattern>
+    </servlet-mapping>
+    
+    <!-- Web container primitives (Servlet Mappings) -->
+    <servlet-mapping>
+        <servlet-name>ExplicitGC</servlet-name>
+        <url-pattern>/servlet/ExplicitGC</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>PingServlet</servlet-name>
+        <url-pattern>/servlet/PingServlet</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>PingServletWriter</servlet-name>
+        <url-pattern>/servlet/PingServletWriter</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>PingServlet2Servlet</servlet-name>
+        <url-pattern>/servlet/PingServlet2Servlet</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>PingServlet2ServletRcv</servlet-name>
+        <url-pattern>/servlet/PingServlet2ServletRcv</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>PingServlet2Include</servlet-name>
+        <url-pattern>/servlet/PingServlet2Include</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>PingServlet2IncludeRcv</servlet-name>
+        <url-pattern>/servlet/PingServlet2IncludeRcv</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>PingServlet2Jsp</servlet-name>
+        <url-pattern>/servlet/PingServlet2Jsp</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>PingSession1</servlet-name>
+        <url-pattern>/servlet/PingSession1</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>PingSession2</servlet-name>
+        <url-pattern>/servlet/PingSession2</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>PingSession3</servlet-name>
+        <url-pattern>/servlet/PingSession3</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>PingJDBCRead</servlet-name>
+        <url-pattern>/servlet/PingJDBCRead</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>PingJDBCWrite</servlet-name>
+        <url-pattern>/servlet/PingJDBCWrite</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+	<servlet-name>PingServlet2JNDI</servlet-name>
+	<url-pattern>/servlet/PingServlet2JNDI</url-pattern>
+    </servlet-mapping>
+    <!-- End of Web container primitives (Servlet Mappings) -->
+
+    
+    <session-config>
+        <session-timeout>30</session-timeout>
+    </session-config>
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+    </welcome-file-list>
+    <error-page>
+        <exception-type>java.lang.Exception</exception-type>
+        <location>/error.jsp</location>
+    </error-page>
+    <error-page>
+        <error-code>500</error-code>
+        <location>/error.jsp</location>
+    </error-page>
+    
+</web-app>

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/account.jsp
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/account.jsp?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/account.jsp (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/account.jsp Sun Feb 27 18:28:26 2011
@@ -0,0 +1,320 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Style-Type" content="text/css">
+<TITLE>Trade Account information</TITLE>
+<LINK rel="stylesheet" href="style.css" type="text/css" />
+</HEAD>
+<BODY bgcolor="#ffffff" link="#000099" vlink="#000099">
+<%@ page
+	import="java.util.Collection,java.util.Iterator,java.math.BigDecimal,org.apache.aries.samples.ariestrader.api.*,org.apache.aries.samples.ariestrader.api.persistence.*,org.apache.aries.samples.ariestrader.util.*"
+	session="true" isThreadSafe="true" isErrorPage="false"%>
+<jsp:useBean id="results" scope="request" type="java.lang.String" />
+<jsp:useBean id="accountData"
+	type="org.apache.aries.samples.ariestrader.api.persistence.AccountDataBean"
+	scope="request" />
+<jsp:useBean id="accountProfileData"
+	type="org.apache.aries.samples.ariestrader.api.persistence.AccountProfileDataBean"
+	scope="request" />
+<jsp:useBean id="orderDataBeans" type="java.util.Collection"
+	scope="request" />
+<TABLE height="54">
+	<TBODY>
+		<TR>
+			<TD bgcolor="#c93333" align="left" width="640" height="10" colspan=5><B><FONT
+				color="#ffffff">AriesTrader Account</FONT></B></TD>
+			<TD align="center" bgcolor="#000000" width="100" height="10"><FONT
+				color="#ffffff"><B>AriesTrader</B></FONT></TD>
+		</TR>
+		<TR align="left">
+			<TD><B><A href="app?action=home">Home</A></B><B> </B></TD>
+			<TD><B><A href="app?action=account">Account</A></B><B> </B></TD>
+			<TD><B><A href="app?action=portfolio">Portfolio</A></B><B> </B></TD>
+			<TD><B><A href="app?action=quotes&amp;symbols=s:0,s:1,s:2,s:3,s:4">Quotes/Trade</A></B></TD>
+			<TD><B><A href="app?action=logout">Logoff</A></B></TD>
+			<TD></TD>
+		</TR>
+		<TR>
+			<TD align="right" colspan="6">
+			<HR>
+			<FONT color="#ff0000" size="-2"><%=new java.util.Date()%></FONT></TD>
+		</TR>
+		<%
+boolean showAllOrders = request.getParameter("showAllOrders") == null ? false
+                    : true;
+            Collection closedOrders = (Collection) request
+                    .getAttribute("closedOrders");
+            if ((closedOrders != null) && (closedOrders.size() > 0)) {
+
+                %>
+		<TR>
+			<TD colspan="6" bgcolor="#ff0000"><BLINK><B><FONT color="#ffffff">Alert:
+			The following Order(s) have completed.</FONT></B></BLINK></TD>
+		</TR>
+		<TR align="center">
+			<TD colspan="6">
+			<TABLE border="1" style="font-size: smaller">
+				<TBODY>
+					<%
+Iterator it = closedOrders.iterator();
+                while (it.hasNext()) {
+                    OrderDataBean closedOrderData = (OrderDataBean) it.next();
+%>
+					<TR align="center">
+						<TD><A href="docs/glossary.html">order ID</A></TD>
+						<TD><A href="docs/glossary.html">order status</A></TD>
+						<TD><A href="docs/glossary.html">creation date</A></TD>
+						<TD><A href="docs/glossary.html">completion date</A></TD>
+						<TD><A href="docs/glossary.html">txn fee</A></TD>
+						<TD><A href="docs/glossary.html">type</A></TD>
+						<TD><A href="docs/glossary.html">symbol</A></TD>
+						<TD><A href="docs/glossary.html">quantity</A></TD>
+					</TR>
+					<TR align="center">
+						<TD><%=closedOrderData.getOrderID()%></TD>
+						<TD><%=closedOrderData.getOrderStatus()%></TD>
+						<TD><%=closedOrderData.getOpenDate()%></TD>
+						<TD><%=closedOrderData.getCompletionDate()%></TD>
+						<TD><%=closedOrderData.getOrderFee()%></TD>
+						<TD><%=closedOrderData.getOrderType()%></TD>
+						<TD><%=FinancialUtils.printQuoteLink(closedOrderData
+                                    .getSymbol())%></TD>
+						<TD><%=closedOrderData.getQuantity()%></TD>
+					</TR>
+					<%
+}
+%>
+
+				</TBODY>
+			</TABLE>
+			</TD>
+		</TR>
+		<%
+}
+%>
+	</TBODY>
+</TABLE>
+<TABLE width="620">
+	<TBODY>
+		<TR>
+			<TD valign="top" width="643">
+			<TABLE width="100%">
+				<TBODY>
+					<TR>
+						<TD colspan="8"><FONT color="#ff0000"><%=results%></FONT></TD>
+					</TR>
+					<TR>
+						<TD colspan="8" align="left" bgcolor="#cccccc"><B>Account
+						Information</B></TD>
+					</TR>
+					<TR>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">account
+						created:</A></TD>
+						<TD align="left" valign="bottom" colspan="2"><%=accountData.getCreationDate()%></TD>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">last
+						login: </A></TD>
+						<TD align="left" valign="bottom" colspan="3"><%=accountData.getLastLogin()%></TD>
+						<TD align="left" valign="bottom"></TD>
+					</TR>
+					<TR>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">account
+						ID</A></TD>
+						<TD valign="bottom"><%=accountData.getAccountID()%></TD>
+						<TD valign="bottom"></TD>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">total
+						logins: </A></TD>
+						<TD valign="bottom"><%=accountData.getLoginCount()%></TD>
+						<TD valign="bottom"></TD>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">cash
+						balance: </A></TD>
+						<TD valign="bottom"><%=accountData.getBalance()%></TD>
+					</TR>
+					<TR>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">user
+						ID:</A></TD>
+						<TD valign="bottom"><%=accountData.getProfileID()%></TD>
+						<TD valign="bottom"></TD>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">total
+						logouts: </A></TD>
+						<TD valign="bottom"><%=accountData.getLogoutCount()%></TD>
+						<TD valign="bottom"></TD>
+						<TD valign="bottom" align="right"><A href="docs/glossary.html">opening
+						balance: </A></TD>
+						<TD valign="bottom"><%=accountData.getOpenBalance()%></TD>
+					</TR>
+					<TR>
+						<TD colspan="8"></TD>
+					</TR>
+				</TBODY>
+			</TABLE>
+			<TABLE width="100%">
+				<TBODY>
+
+					<TR>
+						<TD colspan="5" bgcolor="#cccccc"><B>Total Orders: </B><%=orderDataBeans.size()%></TD>
+						<TD bgcolor="#cccccc" align="right"><B><A
+							href="app?action=account&amp;showAllOrders=true">show all orders</A></B></TD>
+					</TR>
+					<TR align="center">
+						<TD colspan="6">
+						<TABLE border="1" style="font-size: smaller">
+							<CAPTION align="bottom"><B>Recent Orders</B></CAPTION>
+							<TBODY>
+								<TR align="center">
+									<TD><A href="docs/glossary.html">order ID</A></TD>
+									<TD><A href="docs/glossary.html">order Status</A></TD>
+									<TD><A href="docs/glossary.html">creation date</A></TD>
+									<TD><A href="docs/glossary.html">completion date</A></TD>
+									<TD><A href="docs/glossary.html">txn fee</A></TD>
+									<TD><A href="docs/glossary.html">type</A></TD>
+									<TD><A href="docs/glossary.html">symbol</A></TD>
+									<TD><A href="docs/glossary.html">quantity</A></TD>
+									<TD><A href="docs/glossary.html">price</A></TD>
+									<TD><A href="docs/glossary.html">total</A></TD>
+								</TR>
+								<%Iterator it = orderDataBeans.iterator();
+            int count = 0;
+            while (it.hasNext()) {
+                if ((showAllOrders == false) && (count++ >= 5))
+                    break;
+                OrderDataBean orderData = (OrderDataBean) it.next();
+
+                %>
+								<TR bgcolor="#fafcb6" align="center">
+									<TD><%=orderData.getOrderID()%></TD>
+									<TD><%=orderData.getOrderStatus()%></TD>
+									<TD><%=orderData.getOpenDate()%></TD>
+									<TD><%=orderData.getCompletionDate()%></TD>
+									<TD><%=orderData.getOrderFee()%></TD>
+									<TD><%=orderData.getOrderType()%></TD>
+									<TD><%=FinancialUtils.printQuoteLink(orderData.getSymbol())%></TD>
+									<TD><%=orderData.getQuantity()%></TD>
+									<TD><%=orderData.getPrice()%></TD>
+									<TD><%=orderData.getPrice().multiply(
+                                new BigDecimal(orderData.getQuantity()))%></TD>
+								</TR>
+								<%}
+
+            %>
+							</TBODY>
+						</TABLE>
+						</TD>
+					</TR>
+					<TR>
+						<TD colspan="6"></TD>
+					</TR>
+				</TBODY>
+			</TABLE>
+            <FORM>
+			<TABLE width="100%">
+				<TBODY>
+					<TR>
+						<TD colspan="6" bgcolor="#cccccc"><B>Account Profile</B></TD>
+					</TR>
+					<TR>
+						<TD align="right" valign="top" width="113"><A
+							href="docs/glossary.html">user ID:</A></TD>
+						<TD align="left" valign="top" colspan="2" width="228"><INPUT
+							size="30" type="text" maxlength="30" readonly name="userID"
+							value="<%= accountProfileData.getUserID() %>"></TD>
+						<TD align="right" valign="top" width="73" colspan="2"><A
+							href="docs/glossary.html">full name: </A></TD>
+						<TD align="left" valign="top"><INPUT size="30" type="text"
+							maxlength="30" name="fullname"
+							value="<%= accountProfileData.getFullName() %>"></TD>
+					</TR>
+					<TR>
+						<TD align="right" width="113"><A href="docs/glossary.html">password:
+						</A></TD>
+						<TD colspan="2" width="228"><INPUT size="30" type="password"
+							maxlength="30" name="password"
+							value="<%= accountProfileData.getPassword() %>"></TD>
+						<TD align="right" width="73" colspan="2"><A
+							href="docs/glossary.html">address: </A></TD>
+						<TD><INPUT size="30" type="text" maxlength="30" name="address"
+							value="<%= accountProfileData.getAddress() %>"></TD>
+					</TR>
+					<TR>
+						<TD align="right" width="113"><A href="docs/glossary.html">confirm
+						password: </A><BR>
+						</TD>
+						<TD colspan="2" align="left" width="228"><INPUT size="30"
+							type="password" maxlength="30" name="cpassword"
+							value="<%= accountProfileData.getPassword() %>"></TD>
+						<TD align="right" width="73" colspan="2"><A
+							href="docs/glossary.html">credit card: </A></TD>
+						<TD align="left"><INPUT size="30" type="text" maxlength="30"
+							name="creditcard"
+							value="<%= accountProfileData.getCreditCard() %>" readonly></TD>
+					</TR>
+					<TR>
+						<TD align="right" width="113"><A href="docs/glossary.html">email
+						address: </A></TD>
+						<TD colspan="2" align="left" width="228"><INPUT size="30"
+							type="text" maxlength="30" name="email"
+							value="<%= accountProfileData.getEmail() %>"></TD>
+						<TD align="right" width="73" colspan="2"></TD>
+						<TD align="center"><INPUT type="submit" name="action"
+							value="update_profile"></TD>
+					</TR>
+					<TR>
+						<TD width="113"></TD>
+						<TD colspan="5"></TD>
+					</TR>
+				</TBODY>
+			</TABLE>
+            </FORM>
+			</TD>
+		</TR>
+	</TBODY>
+</TABLE>
+<TABLE height="54" style="font-size: smaller">
+	<TBODY>
+		<TR>
+			<TD colspan="2">
+			<HR>
+			</TD>
+		</TR>
+		<TR>
+			<TD colspan="2">
+			<TABLE width="100%" style="font-size: smaller">
+				<TBODY>
+					<TR>
+						<TD>Note: Click any <A href="docs/glossary.html">symbol</A> for a
+						quote or to trade.</TD>
+						<TD align="right">
+						<FORM action=""><INPUT type="submit" name="action" value="quotes">
+						<INPUT size="20" type="text" name="symbols"
+							value="s:0, s:1, s:2, s:3, s:4"></FORM>
+						</TD>
+					</TR>
+				</TBODY>
+			</TABLE>
+			</TD>
+		</TR>
+		<TR>
+			<TD bgcolor="#c93333" align="left" width="640" height="10"><B><FONT
+				color="#ffffff">AriesTrader Account</FONT></B></TD>
+			<TD align="center" bgcolor="#000000" width="100" height="10"><FONT
+				color="#ffffff"><B>AriesTrader</B></FONT></TD>
+		</TR>
+	</TBODY>
+</TABLE>
+</BODY>
+</HTML>

Added: aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/accountImg.jsp
URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/accountImg.jsp?rev=1075106&view=auto
==============================================================================
--- aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/accountImg.jsp (added)
+++ aries/tags/samples-0.1-incubating/ariestrader/modules/ariestrader-web/src/main/resources/accountImg.jsp Sun Feb 27 18:28:26 2011
@@ -0,0 +1,335 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+<META http-equiv="Content-Style-Type" content="text/css">
+<TITLE>AriesTrader Account Information</TITLE>
+<LINK rel="stylesheet" href="style.css" type="text/css" />
+</HEAD>
+<BODY bgcolor="#ffffff" link="#000099" vlink="#000099">
+<%@ page
+	import="java.util.Collection, java.util.Iterator, java.math.BigDecimal, org.apache.aries.samples.ariestrader.api.*, org.apache.aries.samples.ariestrader.api.persistence.*, org.apache.aries.samples.ariestrader.util.*"
+	session="true" isThreadSafe="true" isErrorPage="false"%>
+<jsp:useBean id="results" scope="request" type="java.lang.String" />
+<jsp:useBean id="accountData"
+	type="org.apache.aries.samples.ariestrader.api.persistence.AccountDataBean"
+	scope="request" />
+<jsp:useBean id="accountProfileData"
+	type="org.apache.aries.samples.ariestrader.api.persistence.AccountProfileDataBean"
+	scope="request" />
+<jsp:useBean id="orderDataBeans" type="java.util.Collection"
+	scope="request" />
+<TABLE height="54">
+	<TBODY>
+		<TR>
+			<TD bgcolor="#c93333" align="left" width="640" height="10" colspan=5><B><FONT
+				color="#ffffff">AriesTrader Account</FONT></B></TD>
+			<TD align="center" bgcolor="#000000" width="100" height="10"><FONT
+				color="#ffffff"><B>AriesTrader</B></FONT></TD>
+		</TR>
+		<TR align="left">
+			<TD><A href="app?action=home"><IMG src="images/menuHome.gif" width="80"
+				height="20" border="0" alt=""></A></TD>
+			<TD><A href="app?action=account"><IMG src="images/account.gif"
+				width="80" height="20" border="0" alt=""></A></TD>
+			<TD><B><A href="app?action=portfolio"><IMG src="images/portfolio.gif"
+				width="80" height="20" border="0" alt=""></A> </B></TD>
+			<TD><A href="app?action=quotes&amp;symbols=s:0,s:1,s:2,s:3,s:4"><IMG
+				src="images/quotes.gif" width="80" height="20" border="0" alt=""></A></TD>
+			<TD><A href="app?action=logout"><IMG src="images/logout.gif"
+				width="80" height="20" border="0" alt=""></A></TD>
+			<TD><IMG src="images/graph.gif" width="32" height="32" border="0"
+				alt=""></TD>
+		</TR>
+		<TR>
+			<TD align="left" colspan="6"><IMG src="images/line.gif" width="600"
+				height="6" border="0" alt=""><FONT color="#ff0000" size="-2"><BR>
+			<%= new java.util.Date() %></FONT></TD>
+		</TR>
+		<%
+boolean showAllOrders = request.getParameter("showAllOrders")==null?false:true;
+Collection closedOrders = (Collection)request.getAttribute("closedOrders");
+if ( (closedOrders != null) && (closedOrders.size()>0) )
+{
+%>
+		<TR>
+			<TD colspan="6" bgcolor="#ff0000"><BLINK><B><FONT color="#ffffff">Alert:
+			The following Order(s) have completed.</FONT></B></BLINK></TD>
+		</TR>
+		<TR align="center">
+			<TD colspan="6">
+			<TABLE border="1" style="font-size: smaller">
+				<TBODY>
+					<%
+	Iterator it = closedOrders.iterator();
+	while (it.hasNext() )
+	{
+		OrderDataBean closedOrderData = (OrderDataBean)it.next();
+%>
+					<TR align="center">
+						<TD><A href="docs/glossary.html">order ID</A></TD>
+						<TD><A href="docs/glossary.html">order status</A></TD>
+						<TD><A href="docs/glossary.html">creation date</A></TD>
+						<TD><A href="docs/glossary.html">completion date</A></TD>
+						<TD><A href="docs/glossary.html">txn fee</A></TD>
+						<TD><A href="docs/glossary.html">type</A></TD>
+						<TD><A href="docs/glossary.html">symbol</A></TD>
+						<TD><A href="docs/glossary.html">quantity</A></TD>
+					</TR>
+					<TR align="center">
+						<TD><%= closedOrderData.getOrderID()%></TD>
+						<TD><%= closedOrderData.getOrderStatus()%></TD>
+						<TD><%= closedOrderData.getOpenDate()%></TD>
+						<TD><%= closedOrderData.getCompletionDate()%></TD>
+						<TD><%= closedOrderData.getOrderFee()%></TD>
+						<TD><%= closedOrderData.getOrderType()%></TD>
+						<TD><%= FinancialUtils.printQuoteLink(closedOrderData.getSymbol())%></TD>
+						<TD><%= closedOrderData.getQuantity()%></TD>
+					</TR>
+					<%
+	}
+%>
+
+				</TBODY>
+			</TABLE>
+			</TD>
+		</TR>
+		<%
+}
+%>
+	</TBODY>
+</TABLE>
+<TABLE width="620">
+	<TBODY>
+		<TR>
+			<TD valign="top" width="643">
+			<TABLE width="100%">
+				<TBODY>
+					<TR>
+						<TD colspan="8"><FONT color="#ff0000"><%= results %></FONT></TD>
+					</TR>
+					<TR>
+						<TD colspan="8" align="left" bgcolor="#cccccc"><B>Account
+						Information</B></TD>
+					</TR>
+					<TR>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">account
+						created:</A></TD>
+						<TD align="left" valign="bottom" colspan="2"><%= accountData.getCreationDate()
+%></TD>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">last
+						login: </A></TD>
+						<TD align="left" valign="bottom" colspan="3"><%= accountData.getLastLogin()
+%></TD>
+						<TD align="left" valign="bottom"></TD>
+					</TR>
+					<TR>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">account
+						ID</A></TD>
+						<TD valign="bottom"><%= accountData.getAccountID()
+%></TD>
+						<TD valign="bottom"></TD>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">total
+						logins: </A></TD>
+						<TD valign="bottom"><%= accountData.getLoginCount()
+%></TD>
+						<TD valign="bottom"></TD>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">cash
+						balance: </A></TD>
+						<TD valign="bottom"><%= accountData.getBalance()
+%></TD>
+					</TR>
+					<TR>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">user
+						ID:</A></TD>
+						<TD valign="bottom"><%= accountData.getProfileID()
+%></TD>
+						<TD valign="bottom"></TD>
+						<TD align="right" valign="bottom"><A href="docs/glossary.html">total
+						logouts: </A></TD>
+						<TD valign="bottom"><%= accountData.getLogoutCount()
+%></TD>
+						<TD valign="bottom"></TD>
+						<TD valign="bottom" align="right"><A href="docs/glossary.html">opening
+						balance: </A></TD>
+						<TD valign="bottom"><%= accountData.getOpenBalance()
+%></TD>
+					</TR>
+					<TR>
+						<TD colspan="8"></TD>
+					</TR>
+				</TBODY>
+			</TABLE>
+			<TABLE width="100%">
+				<TBODY>
+
+					<TR>
+						<TD colspan="5" bgcolor="#cccccc"><B>Total Orders: </B><%= orderDataBeans.size()
+%></TD>
+						<TD bgcolor="#cccccc" align="right"><B><A
+							href="app?action=account&amp;showAllOrders=true">show all orders</A></B></TD>
+					</TR>
+					<TR align="center">
+						<TD colspan="6">
+						<TABLE border="1" style="font-size: smaller">
+							<CAPTION align="bottom"><B>Recent Orders</B></CAPTION>
+							<TBODY>
+								<TR align="center">
+									<TD><A href="docs/glossary.html">order ID</A></TD>
+									<TD><A href="docs/glossary.html">order Status</A></TD>
+									<TD><A href="docs/glossary.html">creation date</A></TD>
+									<TD><A href="docs/glossary.html">completion date</A></TD>
+									<TD><A href="docs/glossary.html">txn fee</A></TD>
+									<TD><A href="docs/glossary.html">type</A></TD>
+									<TD><A href="docs/glossary.html">symbol</A></TD>
+									<TD><A href="docs/glossary.html">quantity</A></TD>
+									<TD><A href="docs/glossary.html">price</A></TD>
+									<TD><A href="docs/glossary.html">total</A></TD>
+								</TR>
+								<% 
+Iterator it = orderDataBeans.iterator();
+int count=0;
+while (it.hasNext()) {
+    if ( (showAllOrders == false) && (count++ >= 5) )
+    	break;
+	OrderDataBean orderData = (OrderDataBean) it.next();                        	
+                         %>
+								<TR bgcolor="#fafcb6" align="center">
+									<TD><%= orderData.getOrderID() %></TD>
+									<TD><%= orderData.getOrderStatus() %></TD>
+									<TD><%= orderData.getOpenDate() %></TD>
+									<TD><%= orderData.getCompletionDate() %></TD>
+									<TD><%= orderData.getOrderFee() %></TD>
+									<TD><%= orderData.getOrderType() %></TD>
+									<TD><%= FinancialUtils.printQuoteLink(orderData.getSymbol()) %></TD>
+									<TD><%= orderData.getQuantity() %></TD>
+									<TD><%= orderData.getPrice() %></TD>
+									<TD><%= orderData.getPrice().multiply(new BigDecimal(orderData.getQuantity())) %></TD>
+								</TR>
+								<% }
+				%>
+							</TBODY>
+						</TABLE>
+						</TD>
+					</TR>
+					<TR>
+						<TD colspan="6"></TD>
+					</TR>
+				</TBODY>
+			</TABLE>
+            <FORM>
+			<TABLE width="100%">
+				<TBODY>
+					<TR>
+						<TD colspan="6" bgcolor="#cccccc"><B>Account Profile</B></TD>
+					</TR>
+					<TR>
+						<TD align="right" valign="top" width="113"><A
+							href="docs/glossary.html">user ID:</A></TD>
+						<TD align="left" valign="top" colspan="2" width="228"><INPUT
+							size="30" type="text" maxlength="30" readonly name="userID"
+							value="<%= accountProfileData.getUserID() %>"></TD>
+						<TD align="right" valign="top" width="73" colspan="2"><A
+							href="docs/glossary.html">full name: </A></TD>
+						<TD align="left" valign="top"><INPUT size="30" type="text"
+							maxlength="30" name="fullname"
+							value="<%= accountProfileData.getFullName() %>"></TD>
+					</TR>
+					<TR>
+						<TD align="right" width="113"><A href="docs/glossary.html">password:
+						</A></TD>
+						<TD colspan="2" width="228"><INPUT size="30" type="password"
+							maxlength="30" name="password"
+							value="<%= accountProfileData.getPassword() %>"></TD>
+						<TD align="right" width="73" colspan="2"><A
+							href="docs/glossary.html">address: </A></TD>
+						<TD><INPUT size="30" type="text" maxlength="30" name="address"
+							value="<%= accountProfileData.getAddress() %>"></TD>
+					</TR>
+					<TR>
+						<TD align="right" width="113"><A href="docs/glossary.html">confirm
+						password: </A><BR>
+						</TD>
+						<TD colspan="2" align="left" width="228"><INPUT size="30"
+							type="password" maxlength="30" name="cpassword"
+							value="<%= accountProfileData.getPassword() %>"></TD>
+						<TD align="right" width="73" colspan="2"><A
+							href="docs/glossary.html">credit card: </A></TD>
+						<TD align="left"><INPUT size="30" type="text" maxlength="30"
+							name="creditcard"
+							value="<%= accountProfileData.getCreditCard() %>" readonly></TD>
+					</TR>
+					<TR>
+						<TD align="right" width="113"><A href="docs/glossary.html">email
+						address: </A></TD>
+						<TD colspan="2" align="left" width="228"><INPUT size="30"
+							type="text" maxlength="30" name="email"
+							value="<%= accountProfileData.getEmail() %>"></TD>
+						<TD align="right" width="73" colspan="2"></TD>
+						<TD align="center"><INPUT type="submit" name="action"
+							value="update_profile"></TD>
+					</TR>
+					<TR>
+						<TD width="113"></TD>
+						<TD colspan="5"></TD>
+					</TR>
+				</TBODY>
+			</TABLE>
+            </FORM>
+			</TD>
+		</TR>
+	</TBODY>
+</TABLE>
+<TABLE height="54" style="font-size: smaller">
+	<TBODY>
+		<TR>
+			<TD colspan="2">
+			<HR>
+			</TD>
+		</TR>
+		<TR>
+			<TD colspan="2">
+			<TABLE width="100%" style="font-size: smaller">
+				<TBODY>
+					<TR>
+						<TD>Note: Click any <A href="docs/glossary.html">symbol</A> for a
+						quote or to trade.</TD>
+						<TD align="right">
+						<FORM action=""><INPUT type="submit" name="action" value="quotes">
+						<INPUT size="20" type="text" name="symbols"
+							value="s:0, s:1, s:2, s:3, s:4"></FORM>
+						</TD>
+					</TR>
+				</TBODY>
+			</TABLE>
+			</TD>
+		</TR>
+		<TR>
+			<TD bgcolor="#c93333" align="left" width="640" height="10"><B><FONT
+				color="#ffffff">AriesTrader Account</FONT></B></TD>
+			<TD align="center" bgcolor="#000000" width="100" height="10"><FONT
+				color="#ffffff"><B>AriesTrader</B></FONT></TD>
+		</TR>
+		<TR>
+			<TD colspan="4" align="center"><IMG src="images/ticker-anim.gif"
+				width="385" height="22" border="0" align="middle" alt=""></TD>
+		</TR>
+	</TBODY>
+</TABLE>
+</BODY>
+</HTML>