hans meiser

Greenhorn
+ Follow
since Dec 29, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by hans meiser

Ok sorry, now the code is in the right Tags!

I m still stuck with this problem.
15 years ago
please someone help me...
15 years ago
yes i have the getter and setter in my class. And in the other classes it works perfect.. but here it doesnt... any idea?

Maybe it is a problem, that i have the pageLoad() Method and the addBuzzword() Method in the same action?

Here is the whole ActionClass again:







15 years ago
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
15 years ago
Can you tell me how i have to implement this on one JSP site? how can i use the stored values after that in my action class?

It would be very helpful, if you could post a short example?

Thank you very much...
15 years ago
Hi guys.

I would like to create a Form where a user can enter a text, and then enter multiple buzzwords which match to the text.

My first Idea was to make a input field and to write, that the user has to seperate each buzzword with a ; in the input field. so i could operate with string operations an fill each buzzword into the database.

now my question is, if there is a possibility to make a input form, which generates a new empty input field, if you fill in the first on? so the user can add as many buzzwords as he likes?

this would be easyier to handle for the user.

Thanks for your input!
15 years ago
Hi again!

i have the following problem.

my first action class:

public class CustomerCloseProblemAction 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 problemNumber = null;

public String close()
{
try
{
DataStoreUnit dataStoreUnit = new DataStoreUnit();
dataStoreUnit.closeTicket(problemNumber);
return Action.SUCCESS;
} catch (Exception e)
{
// TODO Auto-generated catch block
ex = e;
return Action.ERROR;
}
}



my Struts.xml :


<action name="Customer_Ticket_Close_Ticket_Detail"
class="de.bamos.ticketsystem.struts.data.CustomerCloseProblemAction" method="close">
<result name="error">/WEB-INF/jsp/pages/ErrorPage.jsp</result>
<result name="success" type="redirect-action">Customer_Ticket_Page_Load_From_Overview</result>
</action>


action name="Customer_Ticket_Page_Load_From_Overview"
class="de.bamos.ticketsystem.struts.data.CustomerProblemDetailLoad" method="loadFromProblemNumber">
<result name="success">/WEB-INF/jsp/pages/CustomerTicketPage.jsp</result>
<result name="error">/WEB-INF/jsp/pages/Error.jsp</result>
</action>


my second action class:


public class CustomerProblemDetailLoad 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 Vector<Comment> commentField = null;
private String problemNumber;
private Problem problem = null;
private String problemNumberSession;


/**
* Um ein neu Erstelltes Ticket anzuzeigen, wird die TicketNummer aus der Session genommen.
* @return
*/
public String loadFromSession()
{
try
{
problemNumberSession = (String) session.get(TicketSystemSessionConstants.PROBLEM_NUMBER_GENERATED);
DataLoadUnit dataLoadUnit = new DataLoadUnit();
commentField = dataLoadUnit.LoadComments(problemNumberSession);
problem = dataLoadUnit.loadProblem(problemNumberSession);
return Action.SUCCESS;

} catch (Exception e)
{
ex = e;
return Action.ERROR;
}
}

/**
* Um ein vorhandenes Ticket anzuzeigen, wird die Ticketnummer übergeben.
*/
public String loadFromProblemNumber()
{
try
{
DataLoadUnit dataLoadUnit = new DataLoadUnit();
commentField = dataLoadUnit.LoadComments(problemNumber);
problem = dataLoadUnit.loadProblem(problemNumber);
return Action.SUCCESS;

} catch (Exception e)
{
ex = e;
return Action.ERROR;
}
}




now i would like to pass my variable problemNumber, from the first action class to the second class, and use it there. Is there any way to make that happen?

Thank you for your help!
15 years ago
OK, its working now, i think my getter was from the wrong type...:S

But it only works once... if i add a comment to my page, and reload the same page, add another comment, then the problemNumber is null again

any idea?
15 years ago
ok i tried it out now.. but still same error.. problemNumber is always null.


<s:form action="Add_Comment" method="POST">
<table>
<tr>
<s roperty value="problem.problemNumber"/>
<s ropertyvalue="problem.problemTitle" />
<s roperty value="problem.problemDescription"/>
<s roperty value="problem.problemStatus"/>
<s roperty value="problem.problemPriority"/>
<tr>
<s:iterator value="commentField">
<tr>
<td>
<s roperty value="CommentNumber"/>
<s roperty value="CommentCreationDate"/>
<s roperty value="CommentText"/>
</td>
</tr>
</s:iterator>
<s:textarea label="Kommentar" name="CommentText"/>
<s:submit value="Kommentar hinzuf�gen" cssClass="InputButton"/>
</table>
</s:form>

<s:form action="Problem_load" method="POST">
<s:submit value="Zur�ck zur �bersicht" cssClass="InputButton"/>
</s:form>
15 years ago
i have a short other question.

i know how to iterate over a vector with objects and display the values in those objects.

But now, if i have in those Objects, again an Object and i would like to display the values, how can i do that?

Vector<Object<Object.value>>
15 years ago
Ok, i will try that, thanks again to you!!
15 years ago
Ok, thanks, i understand the problem now..

but if i need those values only in my second action, can i surround the whole table with the form tag?
15 years ago
Hello!

I have the followig problem:

i have this jsp page:

<body>
Sie Sind jetzt auf der CustomerTicketPage.jsp


<table>
<tr>
<s roperty value="problem.problemNumber"/>
<s ropertyvalue="problem.problemTitle" />
<s roperty value="problem.problemDescription"/>
<s roperty value="problem.problemStatus"/>
<s roperty value="problem.problemPriority"/>
<tr>

<s:iterator value="commentField">
<tr>
<td>
<s roperty value="CommentNumber"/>
<s roperty value="CommentCreationDate"/>
<s roperty value="CommentText"/>
</td>
</tr>
</s:iterator>
</table>

<s:form action="Problem_load" method="POST">
<s:submit value="Zur�ck zur �bersicht" cssClass="InputButton"/>
</s:form>

<s:form action="Add_Comment" method="POST">
<s:textarea label="Kommentar" name="CommentText"/>
<s:submit value="Kommentar hinzuf�gen" cssClass="InputButton"/>
</s:form>


</body>
</html>



in my Add_Comment Action class, i would like to use the commentText, which works perfectly if i add commentText variable to the class, and getter/setter.

But, i also need the problemNumber, but its always null if i make a variable and getters/setters. Do i need to put the problemNumber somehow into the

<s:form action="Add_Comment" method="POST">
<s:textarea label="Kommentar" name="CommentText"/>
<s:submit value="Kommentar hinzuf�gen" cssClass="InputButton"/>
</s:form>


part?

Thanks for your help!
15 years ago
Ok, the second version works perfect!

Thank you very very much for your help, you saved my day! and the rest of the old year
15 years ago
nothing happens if i click on the link...
15 years ago