Narasimha Rao B.

Ranch Hand
+ Follow
since Aug 26, 2002
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Narasimha Rao B.

Hi Merrill,

Thanks so much for your inputs, i have seen your many postings and got the good information, still i have some issues, it would be great if you can help.
My issue is, i can display the values in the jsp page, but when i try to submit the page, modified values are not populating to the form bean, instead old values are populating.

My code details are -

In my Action class, i have a ArrayList, which holds list of 'Profile', the 'Profile' Class has one property name 'Rating' and a collection of 'ProfileComponent' and 'ProfileComponent' has a property named 'Value'. My requirement is loop through top ArrayList and display one row each for one ArrayList element, and in each row display first 'Rating' and then loop through collection of 'ProfileComponent' and display the property 'Value'. The display part is fine, but when the user modifies the 'Rating' or 'Value' (of 'ProfileComponent'), the modified 'Rating' values are reflecting in ActionForm bean, but the modified 'Value' are not reflecting in ActionForm bean.

JSP Code:
<nested:iterate name="spreadActionForm" id="spreadItem" property="spreadList" >
<html:text name="spreadItem" property="rating" indexed="true" />
<nested:iterate name="spreadItem" property="profileCompoList" id="profileComp">
<nested:text name="profileComp" property="value" indexed="true" />



ActionForm :

public void setSpreadList(List spreadsList){ this.spreadList = spreadsList;}
public List getSpreadList(){ return this.spreadList;}
private List spreadList;

public Profile getSpreadItem(int index){
if(this.spreadList == null){ this.spreadList = new ArrayList();}
return (Profile) spreadList.get(index);}

Profile class:
public ArrayList getProfileCompoList(){ return this.profileCompoList; }
public void setProfileCompoList(ArrayList profiles){ this.profileCompoList = profiles ; }
private ArrayList profileCompoList;

public String getRating() { return rating; }
public void setRating(String rating) { this.rating = rating; }
private String rating;

public ProfileComponent getProfileComp(int index){return ((ProfileComponent)profileCompoList.get(index));}

ProfileComponet class:
public double getValue() { return value; }
public void setValue(double value) {this.value = value; }
private double value;

Thanks so much in Advance.
13 years ago
I am using the iterate tag to populate the jsp page from formbean, it is working fine, but when the user modifies the values in the jsp page, when priting the values in the form bean it is printing the old values(intial values that are populated the jsp page) instead of the modified values in jsp page.

My JSP code looks like,
<nested:iterate id="spreadDetails" name="limitSpreadActionForm" property="spreadList" type="com.code.ProfileComponent">
<nested:text name="spreadDetails" property="value" />
</td> </tr>
In the JSP page, at the top formbean is defined as - 'limitSpreadActionForm', this formbean has a property named - 'spreadList', which is of type ArrayList, this ArrayList contains the Objects of type 'ProfileComponent', the 'ProfileComponent' class has a property name 'value'

When i run the code in debug mode, in BeanUtils.setProperty, method displays the values correctly(i.e. Modified values in the JSP page), but when i try to print the values in the ActionForm class, only the old values are printing, not the user modified values.

Thanks in Advance.
13 years ago

Could some one help me on ...
Issues when the checkbox is checked and disabled...
I have a check box that should be checked and disabled based on the particular condition.
i have logic in jsp page, based on the particular condition, i am checking the checkbox and disabling it
but when the values are passed to execute method in action class the value is passed as false instead of true
if i enable the checkbox the values are properly passing to the action class execute method.

Thanks in Advance..
13 years ago

I am working in a java project, recently we have fixed one issue and after that it is running very slow, so i thought will learn how to tune the program.
Just will explain in a 2 liner, how our environment is set up...
Our environment is setup on a unix server machine and will connect to the server(unix machine) from my machine(which is windows) through reflexion x, software.
Our main work is processing the xml messages, our java programmes/processors are running continuously listening to a webmethod queue. External sources will send the messages to these queues, when ever there is a message in queue, our processor will pick and process the message(write into the database)
I got with me optimizeit software, installed on my machine(not on unix machine).
With all this background, Can someone help me out, how to connect the optimizeit running on my machine to server machine and other details.
For me all these is very new, hence asking the basic doubts.

Thanks in Advance,
14 years ago

I am having a basic doubt in UML from UML Distilled, could someone clarify the same,
In the book three perspectives are discussed, those are Conceptual, Specification and Implementation, What is the difference between these three? And When should we use each one? Are these can be used interchangeably?

Hi SJ,

It is really a nice and fully informative post..

Thanks a lot..
Thanks Amit,
Now my doubt got clarified...
Hi Angeles,

Thanks for your reply, but if i keep my print statement in the method declaration, then what will happen? i.e.
public void myMethod(){
(Just ignore if any syntax errors).

Hi Venkatasubramanian,

Thanks for your reply and nice explanation. I am having still one more doubt, will valueUnbound is not called when you remove the attribute from the session? Why none of the methods are called when you call 'req.getSession().removeAttribute("key");' of your code?

Thanks a lot..

I have read, declarations will not produce any output, they are used to declare the methods and to declare the global variable. What happens, if had a statement -- System.out.println("testing declaration"); in the declaration..

Will it produce any output? OR will it give any error?


What is the output of from the below JSP code?
<jsp:useBean id="name" class="java.lang.String" />
<%= name %>

I think answer will be nothing (empty string), because it is equivalent to --
String name = new String();
name is not assigned to any string value, hence its value will be empty string...


What happens when you call destroy() on a servlet instance? I think, container kills all the thread instance running on the servlet, is it correct?.
In one of the jwebplus question explanation is given as -- "The servlet container ensures that all the requests that are being serviced are completed. ", is that mean container waits, till all the threads finishes their job?


I am having a doubt on one of the mock exams questins for K&B book, question no - 55. Below is the question and the answer.
11. public class ServletX extends HttpServlet{
12.public void doGet(HttpServletRequest req,
13.HttpServletResponse resp)
14.throws IOException, ServletException
15.reg.getSession().setAttribute("key",new X());
16.reg.getSession().setAttribute("key",new X());
19. }

and given a listener class

11.public class X implments HttpSessionBindingListener{
12.public void valueBound(HttpSessionBindingEvent event){
14. }
15.public void valueUnbound(HttpSessionBindingEvent event){
17. }
18. }


Here my doubt is, when u try to set the value for 'key' at line 16, i assume previous value will be unbound and the new value is bound, is it true? If thats case, will first previous will be unbound and the new value is bound OR, first new value will be bound and the previous value will be unbound?