pratibha patel

Greenhorn
+ Follow
since Feb 22, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by pratibha patel

Campbell Ritchie wrote:There must be an easier way to do that. What about finding the last index of dot and returning the substring following that?


Thanks a lot for the hint. This resolved my problem
9 years ago
Thanks Campbell for your concern and reply.

Campbell Ritchie wrote:So what you mean is, you want the directory before the * and the extension after the *?
Can you split the path on the *, on the last . and on the last / ?


Yes. You got me right, I want to access all files with extension after * under the directory before *.
Also I tried to split the following path: C:\SampleDirectory\*.txt

Above code returns "txt" string that is fine.
But now how to filter for all txt files under the specified directory(eg. under SampleDirectory) ?
What method should I use to filter files under such scenerio ?
9 years ago
Hello All,

Thanks for your time and kind reply.
I think I have not clearly mentioned the actual problem I am facing.
Let me explain you my query once again.

What I am expecting: To display list of all files under the specified directory (I know it sounds so simple)

What should be the user input: Directory path should be provided by user from console.

for example: C:\SampleDirectory\*.txt

If I provide directory path as above (with asterisk(*.txt)) to display all txt files under \SampleDirectory. Then my code fails here.
for example


Above code variable inputDir ="C:\SampleDirectory\*.txt".
And if a do any operation on this inputDir it fails to operate for files or directories.

for example below code will return false and that is well understood because "*.txt" is not a file name.

So here the problem arises, now is there any way to detect it as a wildcard extension or not a file, If I do any further File operations like filtering for all txt files if user provide *.txt and not hardcoded for file filteration like

I hope you understand my query. Please help.

Thanks in Advance.
9 years ago
Hello,

I am new to java.io.FilenameFilter class.
My requirement is to take directory or file path from console and filter it to display the list of files with specified extensions.
for example: If user enters following path "C:\SampleDirectory\*.txt" then program should be able to display all text files under SampleDirectory.

I have implemented following code but this will not detect "C:\SampleDirectory\*.txt" as a proper file name.
So how "accept" method will work to filter all .txt files if user input is given like *.txt from console.


accept(File obj,String FileName) method which takes one argument of File type & name of files.
It returns true if FileName is present in path identified by obj. What if I give asterisk for all files ?


Please help

Thanks in Advance
9 years ago
Hello Everyone,

I am using Javascript in ASP page to connect to the database. I am not able to figure out where is the problem.
Gettting this error->


Error Type:
ADODB.Recordset (0x800A0E7D)
The connection cannot be used to perform this operation. It is either closed or invalid in this context.
/MyWeb/test.asp, line 12


My code is->

Error occurring for last line while opening a recordset, I don't know what went wrong. Please help.
If someone could please guide me in the right direction I would greatly appreciate it.

Thanking You.

Thanks Ulf for your valuable reply

Ulf Dittmer wrote:Here's a starting point for the POI DOC API: https://coderanch.com/how-to/java/CreateWordDocument



I looked into the code and want to run in eclipse environment. But can you please let me know, what all supporting Jar or lib files are required in order to execute it without an error.

Thanking You !
Hello Everyone,

Can anybody help me on how to generate an MS Word Doc using some Java API ?

My requirement is that I have to generate MS Word doc which will have some text, tables and some circles, squares, triangles to be drawn on text depends on some calculation logic. The text will come from screen or some other document.

I searched, on net and forum also and found some information related to Apache POI, but did not get if this will surely match with my requirement.
Also I have no knowledge about Apache POI and it seems very vast, so not getting from where to start ?


Any kind of help in this regard will be very helpful.

Thanking You !

Hello All,

I am facing problem related to "nbsp" (no-break space).
I have one field on my JSP screen which displays as some value and nbsp appended to it.
For example:

I have product number: p0000111
When I execute my application it displays as-> p0000111nbsp


All over the application nbsp has been used.
Please help me to get to know, what may be the reason behind such problem ?

Thanks.
13 years ago
JSP
Hello,

In my JSP page I have two tables, If I enter something in row of first table, the position of below table gets displaced.

What may be the reason, Please suggest me something.


Thanks.
Hello Karthi,

Thanks for your reply, but my problem has no yet resolved. Find below explanation.

I have tried above code, it calls javascript function"myFunction" but takes value as it is. When I try to get values, for example->

it gives value "${no_list}". Here I want the actual value of no_list.

13 years ago
Hello All,

My Problem is I am not able to call my Javascript function on onclick event of button from struts html:button tag. I am iterating some values from bean and passing those values to Javascript function "MyFunction". How to do that ? I am using struts tag <html:button > instead of pure HTML tag <input type = button>

Below code not working for struts tag for button


If I use pure HTML tag for button then it is working fine->


Please help me on this.
Thanks.
13 years ago
Hello All,

In JSP I am using logic:iterate tag to iterate my collection. In scriptlet I have if and else statements, when certain condition met, I want to break form the loop.
something like this example:

Now I want to break after else conditon from iterate loop. So if I put break, it throws an exception says Code is unreachable.
Example->

Is there any way to break from iterate tag ?

Please do the needful.
Thanks.
13 years ago

A button is an input like any other, as far as HTTP is concerned. To get its value, you need to know its name. To get the list of all parameters names -button or otherwise-, use "request.getParameterNames()"



Actually I was thinking like, "request.getParameterNames()" will work when I have same names and different values. But I have a opposite situation.

But I got the desired result through "request.getParameterNames()" only.

Thanks.
17 years ago
Thank You . I got the result.
17 years ago
If I would have text boxes I would have retrieved the values easily via....

request.getParameter();



But I have buttons here.
So how to get the names of the buttons?
17 years ago