Forum Contributions by Ravindra Verma
We do it for sake of abstraction ie to hide real implementation and provide a single point of connection so others can use it effortlessly. It is used in most of cases when we are going to create complex object(s). When you write any API or utility classes you should prefer using this technique.
Regards
Ravindra
Regards
Ravindra
Yes, Its called Lazy Initialization. Quiet useful if someone is working with objects which are heavy in creation e.g loading images. generally used in image processing. It can be integrated with Factory Pattern too. In normal processing it is not so useful (someone told this), can be replaced by normal object creation.
Regards
Ravindra
Regards
Ravindra
Local variables means the variables defined in a method, they are called as local as they are not accessible/visible out side of method. I guess you don't need any example.
Just think of a java class having main method. When you execute this class from command line, a thread is created and finally main method is called. All the variables you defined inside this main method will be called as 'thread local variable' or 'local variable'.
The reason why they are not visible to other threads is they are not stored in shared memory (heap), each method is assigned its own frames which contains all objects. Heap is the only memory area which is shared among threads, any thread can assess any object if it is visible to it. But if a thread has created a local variable then it's impossible to access it from any other thread.
Regards
Ravindra
Just think of a java class having main method. When you execute this class from command line, a thread is created and finally main method is called. All the variables you defined inside this main method will be called as 'thread local variable' or 'local variable'.
The reason why they are not visible to other threads is they are not stored in shared memory (heap), each method is assigned its own frames which contains all objects. Heap is the only memory area which is shared among threads, any thread can assess any object if it is visible to it. But if a thread has created a local variable then it's impossible to access it from any other thread.
Regards
Ravindra
I would like to share one of my troublesome experience with HTTP Persistence Connections.
Few days back we upgraded our whole environment. WebSphere 6 to WebShpere ND, Newer version of AIX, DB2, Content Manager, java and everything. Suddenly we started getting Thread Hung problem. System logs were filled with thread hung warning messages (i seen that for first time). We didn't know from where to start. We spend a lot of time in our own R&D but no luck. Then we took JVM dump and then analyzed which threads are getting hanged. We figured out few Web-Application threads (servlets) are getting hanged while reading sockets. Then we put out some timeout values to make them non blocking. Thread hung was resolved but application was not functioning. Then we did a lot of R&D and then finally we went to this keep-alive setting. We turned it off and everything was fine. We don't know till now what was wrong with that keep-alive setting. But finally application is working now. We checked our code thoroughly and found no problem. Problem is still a mystery.
Regards
Ravindra
Few days back we upgraded our whole environment. WebSphere 6 to WebShpere ND, Newer version of AIX, DB2, Content Manager, java and everything. Suddenly we started getting Thread Hung problem. System logs were filled with thread hung warning messages (i seen that for first time). We didn't know from where to start. We spend a lot of time in our own R&D but no luck. Then we took JVM dump and then analyzed which threads are getting hanged. We figured out few Web-Application threads (servlets) are getting hanged while reading sockets. Then we put out some timeout values to make them non blocking. Thread hung was resolved but application was not functioning. Then we did a lot of R&D and then finally we went to this keep-alive setting. We turned it off and everything was fine. We don't know till now what was wrong with that keep-alive setting. But finally application is working now. We checked our code thoroughly and found no problem. Problem is still a mystery.
Regards
Ravindra
What kind of requirement is this? Can you explain why this is required?
No you cant do it either. As control goes first to action class then it goes to jsp. It is impossible to do it for one request. You can do it only in case you create a request (HttpUrlConnection) object from jsp to a servlet/action. Furthermore parameters can be passed to servlet/action with request if they are in String format, use session object if you want to pass some objects too then dont forget to remove them once you used them.
Rather than doing all this you must consider re-factor your code/design.
Regards
Ravindra
Rather than doing all this you must consider re-factor your code/design.
Regards
Ravindra
You can not. Struts can not do it, you have to modify struts for that.
If you want it then you need to do it manually, don't use form beans, use simple beans and populate them. Both of them are same only difference is form beans are populated automatically and they extends ActionForm class, similarly you can create your beans which extends ActionForm and populate them.
Regards
Ravindra
If you want it then you need to do it manually, don't use form beans, use simple beans and populate them. Both of them are same only difference is form beans are populated automatically and they extends ActionForm class, similarly you can create your beans which extends ActionForm and populate them.
Regards
Ravindra
To me its just a Web Server setting, you don't need to do anything with it. I had very bad experiences with this keep alive setting of http connections.
Regards
Ravindra
Regards
Ravindra
try changing the port 8080 to something else in conf/server.xml. It could be in use.
Whr r u guys going?
Why you all are running after jar files. Everything seems to be Ok in classpath (at least to me). If jar was not in classpath, compiler wont let you compile.
When looking at the output it is giving "Problem parsing the file" which means there is problem in xml file. your xml is totally ok byt not sure about the dtd file you mentioned in xml. Check the consistency of dtd file and in catch blocks add printstackTrace too. StackTrace will show the actual problem.
Regards
Ravindra
Why you all are running after jar files. Everything seems to be Ok in classpath (at least to me). If jar was not in classpath, compiler wont let you compile.
When looking at the output it is giving "Problem parsing the file" which means there is problem in xml file. your xml is totally ok byt not sure about the dtd file you mentioned in xml. Check the consistency of dtd file and in catch blocks add printstackTrace too. StackTrace will show the actual problem.
Regards
Ravindra
Ravindra Verma
Ravindra
System Engineer
IBM India PVT LTD
Gurgaon, HR
View Complete Profile »
Recent Activity in Forums
![]() | Swamyg added forum topic Kathy Sierra free ebook download for scjp 1.6 certification to watch list |
05-04-2012.
![]() | Swamyg added forum topic Kathy Sierra free ebook download for scjp 1.6 certification to watch list |
05-04-2012.
![]() | Pradeep posted a new forum topic Openings in Cognizant - Chennai - Feb - Mar 2012 in Job Seekers |
28-02-2012.
![]() | Kanchana posted a new forum topic in |
27-02-2012.
![]() | Pradeep posted a new forum topic Job Opening at Cognizant - Core Java, J2EE and SQL Queries in Job Seekers |
25-02-2012.
More forum activity »
Recent Activity in News
![]() | Shravan read the article Transient Variable |
17-04-2012.
![]() | Shravan read the news History of Java |
12-04-2012.
![]() | Treacy gave a thumbs up for news Oracle Certified Professional, Java SE 7 Programmer Upgrade Path Preparation Article |
29-03-2012.
![]() | Treacy read the news Oracle Certified Professional, Java SE 7 Programmer Upgrade Path Preparation Article |
29-03-2012.
![]() | Treacy posted news Oracle Certified Professional, Java SE 7 Programmer Upgrade Path Preparation Article |
29-03-2012.










