%@ page language="java" %> <%@ page import="javax.naming.*, java.util.*, java.io.File, javax.ejb.FinderException, javax.rmi.PortableRemoteObject, java.sql.*, com.scientech.rapid.*" %> <%@ page import="org.apache.struts.util.MessageResources,org.apache.struts.action.Action" %> <%@ page import="java.util.StringTokenizer" %> <%@ taglib uri="/WEB-INF/struts.tld" prefix="struts" %> <%@ page import="javax.sql.*" %> <% //,java.util.Locale,javax.naming.* %> <% String language = request.getHeader( "ACCEPT-LANGUAGE" ); StringTokenizer tokenizer = new StringTokenizer( language, ", ", false ); String lang = ""; if( tokenizer.hasMoreTokens() ) lang = tokenizer.nextToken(); request.getSession().setAttribute("org.apache.struts.action.LOCALE", new Locale(lang,"")); %>
<%= mycondition.getConditionCode() %> <%= mycondition.getDescription() %> <% // myhome.create("03", "The Third test description by Manfred"); // myhome.create("04", "The 4th test description by Manfred"); // myhome.create("05", "The 5th test description by Manfred"); // myhome.create("06", "The Sixth test description by Manfred"); // myhome.create("08", "The 8th test description by Manfred"); // mycondition.setDescription("This is my modified test description by Manfred"); Collection MySearch = myhome.findByDescription("%description%"); %>
Code Description
== ========================================
<%
Iterator it = MySearch.iterator();
while (it.hasNext()) {
mycondition = (Condition)it.next(); //You need to Cast it here.
out.println (mycondition.getConditionCode());
out.println (mycondition.getDescription() + "
");
}
out.println("----");
out.println(getProperty("primarykey"));
out.println("----");
%>