Ok, here is part of the first JSP...
// 1st JSP page
<%@ page language="java" contentType="text/html" %>
<%@ page import="java.io.*" %>
<%@ page import="javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<html>
<head>
<title>Choose market</title>
</head>
<body bgcolor="white">
<%@ include file="header.html" %>
<%
response.addHeader("Pragma", "No-cache");
response.addHeader("Cache-Control", "no-cache");
response.addDateHeader("Expires", 1);
%>
<%!
String sessionId=null; %>
<% HttpSession userSession = request.getSession(true); %>
<% sessionId = userSession.getId(); %>
<% userSession.setAttribute("id",sessionId); %>
<hr>
<h3>Choose a specific guide from the following</h3>
<table border=0>
<tr>
<td>
<form method="get" action="../servlet/WhichMarket">
<select name="market" size="5">
<br>
<option value="usa">US-2000
<option value="canada">CANADA-2000
<option value="mexico">Mexico
</select>
<br>
<input type="submit">
<input type="hidden" name="newSession" value="<%=sessionId %>">
</form>
</td>
<td>The options on the left determine which guide you will make description changes to.
In guide, you need to choose a specific market. Choose a market from the list on the left and hit Submit Query.
</td>
</tr>
</table>
<hr>
<%@ include file="footer.html" %>
</body>
</html>
When the user hits submit query, WhichMarket is called on the server.
// WhichMarket servlet
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import com.xxx.yyy.zzz.SomeBean;
public class WhichMarket extends HttpServlet
{
SomeBean notesData = null;
public void init() throws ServletException
{
//super.init(config);
notesData = new NotesBean();
getServletContext().setAttribute("notesData",notesData);
//req.setAttribute("notesData",notesData);
}
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
res.setContentType("text/plain");
PrintWriter out = res.getWriter();
String userId = null;
String usaguide = null;
String canguide = null;
String mexguide = null;
String sessionId = null;
String userInput = req.getParameter("market");
String unique = req.getParameter("newSession");
String language ="/servlets/language.jsp";
try
{
if(userInput.equals("usa"))
{
int k=1;
usaCodeguide = "450011";
notesData.setGuide(k,usaCodeguide);
notesData.getCodeguide(k);
}
else if(userInput.equals("canada"))
{
int n=1;
canguide = "550012";
notesData.setGuide(n,canCodeguide);
notesData.getCodeguide(n);
}
else
{
int j=1;
mexguide = "27";
notesData.setCodeguide(j,mexCodeguide);
notesData.getCodeguide(j);
}
HttpSession session = req.getSession();
String uid = (String)session.getAttribute("id");
RequestDispatcher familydataRD = getServletContext().getRequestDispatcher("/servlets/language.jsp?userId=" + uid);
familydataRD.forward(req,res);
}
catch(Exception e)
{
out.println("Error: " + e.getMessage());
}
}// end doGet
}// end WhichMarket
This servlet passes a response to the 2nd JSP page, or language.jsp
<%@ page language="java" contentType="text/html" %>
<%@ page import="java.io.*" %>
<%@ page import="javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page import="com.xxx.yyy.zzz.SomeBean"%>
<html>
<head>
<title>Choose language</title>
</head>
<body bgcolor="white">
<%@ include file="header.html" %>
<%! String sessionId=null; %>
<% HttpSession userSession = request.getSession(true); %>
<% String id = (String)session.getAttribute("id"); %>
<%
response.addHeader("Pragma", "No-cache");
response.addHeader("Cache-Control", "no-cache");
response.addDateHeader("Expires", 1);
%>
<jsp:useBean
id="notesData"
class="SomeBean"
scope="application">
</jsp:useBean>
<hr>
<h4>Choose a specific language and year for your query</h4>
<form method="get" action="../servlet/Query">
<select name="language" size="4">
<br>
<option value=1>ENGLISH
<option value=2>ENGLISH,CANADIAN
<option value=3>FRENCH
<option value=4>FRENCH,CANADIAN
<option value=5>GERMAN
<option value=6>ITALIAN
<option value=7>PORTUGESE, BRAZILIAN
<option value=8>SPANISH, CASTILIAN
<option value=9>SPANISH, MEXICAN
</select>
<%! int n=1; %>
<p>
<input type="hidden" name="marketCG" value="<%= notesData.getGuide(n)%>">
<input type="hidden" name="session" value="<%= id %>">
<input type="submit">
</form>
<a href="../servlets/market.jsp">
<img src="../servlets/back.gif" height=44 width=55 alt="previous page" border=0>
</a>
<hr>
<%@ include file="footer.html" %>
</body>
</html>
So, when I hit submit on the market.jsp, the request is processed by WhichMarket servlet and a response is passed to language.jsp. The language .jsp gives and Error message. The error says
Error: com.xxx.yyy.zzz.SomeBean
on the browser. Keep in mind, the first time I tried this it worked fine. I tried it a second time and this error showed up.
Hope you can provide some answers.