Bajji Pat

Ranch Hand
+ Follow
since Apr 05, 2005
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 Bajji Pat

Prototype is used when you are to clone an object i.e. creating customized objects, whereas a template design pattern is used when you want your objects to abide to a specific sequence of processing (etc. an algorithm)
[ May 05, 2006: Message edited by: Bajji Pat ]
D is the correct answer, Object Mapping is mapping data from some system into Object properties.

Originally posted by Apratim Khandalkar:
You are creating a web application for an online product ordering system. You have decided to use connection pooling to reduce load on the databases. Since you have many databases, you want to create one pool instance of the ConnectionPool class for each database. Depending on what is requested, you may have to connect to a variable number of databases. What pattern should you use?
a) Abstract factoryb) Factory Method
c) Builder d) Prototype
e) Singleton
The correct answer is Singleton but i think it should be abstract factory?

I think Singleton is the answer since each of the delegating component (say different sub-systems of the ordering system) would know the DB to connect to and it cannot be from a centralized place (i.e. We get to mention the target DB to connect to from the controller) in which case Abstract Factory would be correct answer!!
[ May 04, 2006: Message edited by: Bajji Pat ]
What do we want to acheive here??, is it that you only want n instances of the object to exist??

In that case what is to be done after n instances are created - throw an exception/ the behavior changes to a singleton then on??
You can use the following snippet- the characters() method would catch any CDATA sections within XML:

[ December 07, 2005: Message edited by: Bajji Pat ]
Hi Ganesh,

The problem must be with the mapping in your web.xml file .

Did u perform the servlet mapping (in web.xml):


In the above case you can invoke this servlet(assuming that u have it inside ROOT ) as

Hope this helps

16 years ago
Probably a classpath problem!! Did u try setting the classpath??

Could u pls post the code??
[ June 13, 2005: Message edited by: Bajji Pat ]
16 years ago
It is because, mostly we use ParserAdapter and not the SAXParser as such, and we use PA's parse method that takes an InputSource or a systemId. We do it because ParserAdapter wraps SAX1 and makes it act as a SAX2 ,with feature, property, and Namespace support etc..

Hope this helps

[ May 20, 2005: Message edited by: Bajji Pat ]
I tried parsing the same string and got the results correctly

Parsing the file using a SAX parser would not load it onto the memory.
U can try using one.
U can do it like this

st = ""+i;
17 years ago


and in the target html file

call a function onload of html and
url = this.location.href
// this would give the entire url
// use split command to retrieve various values
// this returns an array with tokens - just like string tokenizer in java


// use your parameter separator instead of ?

and then use split again on the parameterList[0] to total to retrieve the values..


Is there any opensource implementation of Presence(generic) framework compatible with sip,xmpp ?

If anyone has attempted this,please let me know

17 years ago

It can be done as follows:

on the button include onClick attribute and include a javascript function focus()

and in the script part

function focus()
window.location.href="yourhtmlname.html#the href name";
supposing u want to focus the text <a name="the href name">THIS THE TEXT</a>


U can match the "\n" (newline) and replace them with <br/>