Good morning!
i have a JSP Page, on which i iterate over a vector, to display some values:
<s:form action="Employee_Add_Buzzword" method="POST">
<s:iterator value="buzzwordVector">
<s:property value="buzzword"/>
</s:iterator>
s:textfield label="Schlagwort" name="buzzword" size="60"/>
<s:submit value="Hinzufügen" cssClass="InputButton"/>
</s:form>
there is also a textfield, and a submit button, where i would like to add new words to this vector, and reload the page.
My action class looks like this:
public class EmployeeCreateBuzzwordAction extends ActionSupport implements SessionAware, ValidationAware
{
// braucht es bei jeder action zur identifikation
private static final long serialVersionUID = 1L;
private Map session;
private Exception ex = null;
private String categoryDescription = null;
private ArrayList categories = null;
private String hintText = null;
private String buzzword = null;
private String buzzwordText = null;
private Vector<String> buzzwordVector = null;
public String addBuzzword()
{
try
{
if(buzzwordVector == null)
{
buzzwordVector = new Vector<String>();
}
buzzwordVector.add(buzzword);
DataLoadUnit dataLoadUnit = new DataLoadUnit();
categories = dataLoadUnit.LoadCategories();
return Action.SUCCESS;
} catch (Exception e)
{
ex = e;
return Action.ERROR;
}
}
My problem is, that in my action class the buzzwordVector has always the value "null". This is ok for the first time when i add a new Word, but after that, it should be the same vector as before.
Hope someone can help me!
THank you