|
hi,
change the scope to session , just to track down the problem.
also make sure u have properly defined the form-bean == suchen
to SuchenForm in the config
remove attribute "attribute" in the action mapping if not
needed
-nagi
-------Original Message-------
Date: Monday, July 07,
2003 03:09:19 PM
Subject: Re: Form bean
is not stored in request
Hello again,
it is actually struts that seems to
be expecting the form bean in the request, under name given in
'attribute' in the mapping for the action. At least, the log-file tells
me that struts looks there for the form bean and creates a new one if
it can't find it.
Okay, here is the action mapping for
this:
<action attribute="suchen" input="/index.jsp" name="suchen" path="/suchen" scope="request" type="de.zmnh.struts.action.SuchenAction"
/>
And this is the form bean (I did not copy the imports
btw): public class SuchenForm extends ActionForm {
//
---------------------------------------------------------
Instance Variables private org.apache.log4j.Logger log
= org.apache.log4j.Logger.getLogger(this.getClass().getName());
private
TreeMap fields; private TreeMap params; private Integer
cnt; private boolean archivAnzeigen; private ArrayList
auswahl;
//
---------------------------------------------------------
Methods
public SuchenForm(){ fields = new TreeMap(); params =
new TreeMap(); cnt = new Integer(1); }
/** * Method
validate * @param ActionMapping mapping * @param HttpServletRequest
request * @return ActionErrors */ public ActionErrors
validate( ActionMapping mapping, HttpServletRequest request)
{
ActionErrors err = new ActionErrors();
Integer temp =
(Integer)request.getSession().getAttribute("cnt"); if(temp!=null
&&
(temp.intValue()>cnt.intValue())){ cnt=temp; } if(request.getParameter("mehr")!=null){ LoggerSupport.logDebug("Counter:
"+cnt.intValue(),log); LoggerSupport.logDebug("Mehr Felder Button
gedr�ckt",log); cnt = new
Integer(cnt.intValue()+1); LoggerSupport.logDebug("Counter:
"+cnt.intValue(),log);
}else
if(request.getParameter("weniger")!=null){ LoggerSupport.logDebug("Counter:
"+cnt.intValue(),log); LoggerSupport.logDebug("weniger Felder Button
gedr�ckt",log); LoggerSupport.logDebug("Counter:
"+cnt.intValue(),log); } return err; }
/** * Method
reset * @param ActionMapping mapping * @param HttpServletRequest
request */ public void reset(ActionMapping mapping,
HttpServletRequest request)
{ this.archivAnzeigen=false; }
/** * Returns the
field. * @return String */ public Object getField(String key)
{ if(fields == null) return ""; else
if(fields.get(key)==null) return ""; return
this.fields.get(key); }
public void setField(String key, String
value){ this.fields.put(key,value); }
/** * Returns the
fields. * @return String[] */ public TreeMap getFields()
{ return fields; }
/** * Returns the parameter. *
@return String */ public Object getParameter(String key)
{ if(params == null) return ""; else
if(params.get(key)==null) return ""; return
this.params.get(key); }
public void setParameter(String key,
String value){ this.params.put(key,value); }
/** * Returns
the params. * @return String[] */ public TreeMap getParams()
{ return params; }
/** * Sets the parameter. * @param
parameter The parameter to set */
/** * Returns the
cnt. * @return int */ public Integer getCnt() { return
cnt; }
/** * Feldauswahl */ public Collection
getSearchFields(){ if(auswahl==null){ auswahl = new
ArrayList(); Properties search = new
Properties(); try{ FileInputStream in =
new FileInputStream(InventarKonfiguration.getHandle().getInvpropPath()); search.load(in); }catch(Exception
e){ LoggerSupport.logFatal(e,log); } int i=1; String
temp; while((temp=search.getProperty("search"+i))!=null){ LoggerSupport.logDebug("N�chstes
Element f�r SearchFields Coll.: "+temp,log); SearchOption temp2=new
SearchOption(temp, search.getProperty("value"+i)); auswahl.add(temp2); i++; } } return
auswahl; }
/** * Returns the archivAnzeigen. * @return
boolean */ public boolean isArchivAnzeigen() { return
archivAnzeigen; }
/** * Sets the archivAnzeigen. * @param
archivAnzeigen The archivAnzeigen to set */ public void
setArchivAnzeigen(boolean archivAnzeigen) { this.archivAnzeigen =
archivAnzeigen; }
}
Thanks for the
help.
Greetings, Nadja
--------------------------------------------------------------------- Nadja
Senoucci Universitaet Hamburg Zentrum f�r Molekulare
Neurobiologie Service-Gruppe EDV Falkenried 94 20251
Hamburg Germany Tel.:040 - 428 - 03 - 6619 Fax.:040 - 428 - 03 -
6621
--------------------------------------------------------------------- To
unsubscribe, e-mail: [EMAIL PROTECTED] For
additional commands, e-mail: [EMAIL PROTECTED]
. |