Suvojit Chakraborty

Ranch Hand
+ Follow
since Nov 10, 2009
Merit badge: grant badges
For More
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 Suvojit Chakraborty


I am beginning to apply patterns in my work. I have to make a functionality for export data in pdf and csv format. I am planning to use strategy pattern here. Following is in my mind.
I will have an interface IExportable with a ab method export()

and two implementing classes :


A factory will give me instance of appropriate Exporter. A ExportUtil will contain IExportable ref and a generateExport() to do export :

Am I correct to pick Strategy pattern here? Is my design okay? Can it be improved?

Thanks for help
I know this is a basic question to ask but I need to understand this so I am asking. I have read in various blogs and tutorials about idref in Spring framework. I understand fully the purpose it serve ie provide a bean's name to another bean. This will ensure that a bean which is supplied as idref value to another bean will exist at deployment time else there will be an error. However I dont understand following :

1. What's so great about this feature of idref ? I mean if I don't use idref and use a bean as property to another bean and don't define that bean then also won't I get a BeanCreateException? The container will complain for missing bean, isn't it?

2. I want to understand under what circumstance I would use idref. A real world example will really help a lot.

PS: I read a lot on idref on internet but don't find a satisfactory answer to my questions.

9 years ago
Figured out the solution with help from another forum. HTTPURIType is to be used in insert statement.

insert into table (uricolumn) values (HTTPURIType('')) where actual URL is query parameter.

I am trying to store data in a column of Oracle table using JDBC. The column is of SYS.URITYPE. I learned that to supply data to SYS.URITYPE from java, we need to use I tried exactly same

but still i keep on getting this error :

java.sql.SQLException: ORA-00932: inconsistent datatypes: expected SYS.URITYPE got CHAR

Please help to fix this.

Hi All,

I am facing trouble in handling a situation where value of attribute equals selector may contains an apostrophe. Below is a detailed explanation of my problem :


Here l_val[l_i].split("#")[0] may contain a string like "How many Brother's do you have?". There is a listbox containing question list. Above code removes questions from that list. If the Question to be removed has no apostrophe then it works fine. However with an apostrophe it give error,
"Error: Syntax error, unrecognized expression: option[value=How many Brother's do you have?]"

I am unable to escape the apostrophe.

Please suggest a fix for same.


I am not sure if this problem belongs to JS domain or not, but I am posting it here because IMO this forum is the closest match. (Forgive me in case I am wrong )

I have a situation where in I have to give users option to download a screen (a success screen containing a transaction number). User may download in following formats : RTF, PDF, HTML.
Is there any way to perform this task using js. I dont think I can use window.print() here, becuase user wont be downloading then.
If js cant be used then how should I proceed to have this task completed?


Thanks for reply. Reason is because of poor internet connection. Most of the time everything is ok. But it has been observed that if internet has issues then in that case we can enter information on UI input elements before page gets loaded completely.

Hi all,

I have following situation:

There are pages containing input field where in user enters value. Now I have a requirement to block UI untill the document is ready and every input field is rendered. I have found that I can use blockUI plugin for this :
I have also found few good examples in :

Now, my problem is how do I call $.blockUI() on pre-ready stage and call $.unblockUI(); on .ready(). I would want my UI to be locked untill the doc is ready. I can put call to $.unblockUI(); in .ready() but where do I put $.blockUI().

Please help me in solving this issue.

Thanks in advance.

Thanks for reply.

requiredProvider() is called from inside $(document).ready(function(){ requiredProvider(); }) which I have placed in <script> section of a xsl file which renders xml and generate view.

My problem perhaps will be solved if somehow I can call this from $(document).update()/reload() sort of function. I am not aware of existence of any such function but I am guessing some function to satisfy my need exist.

Thanks for help

I have a requirement of refreshing a div in jquery. The scenario is:
I have following structure in html/jsp:

Now my requirement is to make all the inputs inside the provider-d1 divs required (by puting an asterix after the label), as soon as user input some text in the text box.

following is the jquery code I am using to do this:

I am calling above code on doc.ready(). Now this works perfectly fine in case , provider-d1 div is already present. But there is also a button which clones above div and update the id.
Example: provider-d1 becomes provider-d2 and similarly input elements inside also get incremented.
So if I add another div, the logic in script doesnt get applied because var providers = $('#provider div[id^="provider-d"]'); would return only div which are present during the time pages was loaded. Div generated afterward doesnt get picked.

Please guide me to find a solution so that I may refresh my main div(provider) prior to the var providers = $('#provider div[id^="provider-d"]'); , so that newly added divs also get included in result.

Thanks for help


Eric Pascarello wrote:JavaScript and CSS have poor control over printing.


Thanks for reply Eric.

I have also realized the same. But isnt there any way around to solve this problem?


I have a problem which seems to be trivial but is very annoying. I have a jsp page in which there is a print icon. On clicking print icon, the entire page is printed(depending on rules I specified in print.css file) using window.print() . I have rules which make a perfect printing on 100% scale but on shrink to fit mode, lot of space is left on right side of page. As result letters in print become very small. The problem I am facing is on click of print, the default print mode which is getting selected is Shrink to fit instead of 100%. I wanted to know is there any way by which I can override this behavior to make 100% as the default print mode.

Thanks for help

P.S. I have found on google few hacks for this: like running some commands to change registry. But these wont work as I cant ask clients to run these.
thanks for reply but I could not digest much. Will it not work if I just create a zip containing the website's folder and the mysql's data snapshot. Is there any way I could create a snapshot of the data???

Please specify me detailed steps. I have no idea as to how to create this .sql sript file etc....

thanks for help
13 years ago

I have made a simple J2EE web application which has few pages which pick up and displays data from mysql database. I need to send this project to someone as a proof of my project work. How do I send it?
I am using Netbean6.5 IDE and mysql database. I have included the driver in the library folder of the web project in netbeans. Now I want to know that if I zip the project and mail it to someone, will he be able to run my project. And how to the mail the database in mysql?

Please suggest

13 years ago

David Newton wrote:What, specifically, are you having issues with?

How might pagination work? Well, we need to know how many pages of results there are... this is figured out using the total number of results, and the number of results per page.

We also need to know which results to show on the page: this is probably done by passing in the page number, and using that plus the number of results per page (already mentioned) to figure out the offset into the results.

Maybe try writing some code, or continue searching for "pagination" or "server pagination" if you're still having a problem getting started.

I have gained some knowledge of pagination and I think pagination using repeated access from database suits my requirement. I have found about limit and offset in select clause of mysql. I have found a logic of controlling the number of data extract from database.
If, say, Page variable represent my current page then I could have a query like this:

select * from employee limit 10 offset 10*(page-1);

As said, I will have a page in html like following:

Now, I have also learnt from this forum that no of rows in database can be found by following:

int i= rs.getRow();

where rs=ResultSet obj.

So I can now get the no of pages required like this:

if (i/10==0) then numPage=i/10
else if (i/10!=0) then numPage=i/10+1

Now I can display page links at bottom by having a loop which starts from 1 to numPage

Also I plan to use a static variable page which will keep track of current page.
So the Page number can be displayed by displaying value of page.

But I have following issues:

How do I detect the links clicked's corresponding number. I mean how do I set Page variable to 3 when I click on 3(link) at bottom of page.

Am I moving in right direction? Please give feedback? Any improvement suggestion....

13 years ago