Gary Dhaliwal

Greenhorn
+ Follow
since Oct 17, 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 Gary Dhaliwal

I don't think its a best practice to print from within the method. I think the method should return a list or array. And to print it in your JSP:

<% ArrayList<Employee> employees = (ArrayList)request.getAttribute("employees"); %>

Lorem Ipsum ...

<% for(int i=0;i<employees.size();i++){
out.println(employees.get(i).getName());
} %>
15 years ago
JSP
Think of JSP simply as HTML with Java placeholders. There is no need to embed HTML code in Java.

Do it this way:
<input type="hidden" name="emp" value="<%= name.RETRIEVE_STATE %>">
15 years ago
JSP
Thanks for the replies, but could'nt this simply be achieved using javascript? Something like onsubmit? And please be specific in your responses.
15 years ago
JSP
Hi I wanted to know how would can I display a progess/indicator gif upon submitting a form, due to the fact the form may take several seconds for submission.
15 years ago
JSP
You can leave your validation.xml as is (Make sure you have a <form name=?> tag around your fields).

Now instead of subclassing your form beans from ActionForm subclass from ValidatorForm

ie. Change public class CompanySearchForm extends ActionForm{
to public class CompanySearchForm extends ValidatorForm{

And lastly make sure your action tag in struts-config.xml has validate="true"

i.e. <action path="/createJob" validate="true" ...
[ October 19, 2008: Message edited by: G Dddd ]
15 years ago
I am relatively new also, google "roseindia" it is by far the best resource for Struts.
15 years ago
Hi I was wonder is there a tool or method of monitoring how much memory struts is using or specifically how much memory sessions attributes are consuming?
15 years ago
Hi I was wonder how I could implement a social network-like news feed. For example is John (my contact) changes his phone number or joins a group it should appear in my news feed.

I was thinking of using a table called Feed with two fields message and userIDFK. So when John changes his phone number a row will be stored as follows:

John has updated his profile, 1 (userID)

Then I could just read this table. However problems with designs is that specific information is not stored, like the new phone number or group joined. Although I could include that information in the message field, I would not be able to link to the particular group he joined without a groupID.
15 years ago