Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

amit sharma

Ranch Hand
+ Follow
since Jul 19, 2006
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 amit sharma

I have a buffer class which receives message object. I have to pass this message object to other class. The condition is that if i have 1 message or n milli sec has elapsed, i have t send this messages object to other class.
I have different commands. I make interface with method execute. I make 5 concrete class which implements command interface. This concrete class instantiate in different ways. some require 1 parameter, some require 2. What is the best way to design a class which takes TypeofCommand as input and instantiate correct class so that client can then simply call execute method. TypeofCommand can contains information about which class to instantiate.
I make DAO for USER. I make a new connection in each method(CRUD) of DAO. I want to know what is the best strategy to handle transaction in DAO pattern. How can i call another DAO from DAO class.

David Newton wrote:Honestly, I'd just try searching for "eclipse +uml" first.

i also google for it but with many options i am confused, i try some of them but didn't vey happy with it.
i post question here to get most appropriate tool which many developers are using.
Is there any eclipse plugin which can geneate UML class diagram from jar file or code.
My intention is to learn design of struts, hibernat, spring.

Thanks in advance
I have a webapplication(simple jsp,servlets). There are some desktop applications running on same servers using same database. To increase the performance, i thought of using any caching framework(Oscache,ehcache). Jsp can retrieve some data from database and some other data from cache. A background application can put data into cache and update data at appropriate time. I can put cache in jndi and webapplication can access cache through jndi. The data in cache will change later in application lifetime.
Is this is a good way to use cache across application or there are better way to do it.
Please also give the name of some free jndi/ldap servers.
I have transaction of statements .I am settings AutoCommit to false.But when an error occurs for data truncation in 2nd statement ,it not rollback the changes done by other statement .My need is whenever any error occurs ,the whole batch should be rllback.

Ulf Dittmer wrote:That depends on your requirements, about which we know nothing.

Sorry for stupid and incomplete post .
My requirement is like
I have one table(col1,col2,col3) .There are many columns but my where clause doesn't need it . There are about 3 frequent query
against this table .One query is select on col1(primary key) .Second query is order on col2(int type) . third query is order on col3
.col1,col2 are constant whereas there are frequent updation on col2 .
I want a snapshot of database .Instead of taking data from database ,i can take it from cache .
11 years ago
I am developing a web application .To reduce database load ,i want to cache data which to common to all users .I search a lot for caching framework and find quite a lot(OSCache,EHCache,JCS,Open Terracotta) but now i am confused which to use.Can anyone please tell me which to use
11 years ago

Originally posted by Anil11:
you can pass parameters like this

on page1.xhtml

<ui:include src="page2.xhtml">
<ui:param name="param1" value="one"/>
<ui:param name="param2" value="two"/>


<h:commandLink action="${bean.prevPage}">
<f:param name="prev" value="#{param1}" />


<h:commandLink action="#{bean.nextPage}">
<f:param name="next" value="#{param2}" />


on the backing bean you can access params ..

public String nextPage() {
String nextPage = (String)
FacesContext.getCurrentInstance(). getExternalContext()
return nextPage;
public String prevPage() {
String prevPage = (String)
FacesContext.getCurrentInstance(). getExternalContext()
return prevPage;

Thanks for your reply .
But if some users don't want any parameters i want to use some default value for that parameter.
11 years ago
my code is

I want to pass parameters to DropDown.xhtml .But not everyone will pass parameters to tag .If someone not pass the tag then it should use some default value.
11 years ago
I am using FacesMessage for writing message . my code is

But this message is added twice .I can't use clear as there are other messages.
I want to check whether a message is present for this key is not .If it is present then i can add message otherwise i leave it .
11 years ago
I am using rich faces a4j library.
When i try to use pass data like 'Nov 6 , 2008' to bean it gives me error
Argument type mismatch.
My code is

How can i pass the date through ajax call.
When i am submit the form without ajax call ,i am able to get the date properly.

11 years ago
I am using ROME for generating rss files . My client wants that user can subscribe to rss based on search query.For that i need to generate so many rss files .Is there any better way to do it.

i need to know the country of user so that i can apply customization for that country.
12 years ago