Nasir Munir

+ Follow
since May 31, 2002
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 Nasir Munir

I am getting an input xml file, which I am passing to
I am then parsing it with Factory.parse.
My problem is due to escape sequences of html that comes with the xml document. Is there a way I can get rid of that?
16 years ago
thanks for a good suggestion
It worked !!!
16 years ago
I want to throw an exception from if block which is written in a try block. If there is an exception I want it to be handled in the catch block. If I use throw new Exception() in the "if" statement, will it go to the catch block defined as catch(Exception ex).
Can I get some help here ? thanks.

pseudo code:
16 years ago
another problem:
If I change the date format it returns a string. I have to pass the argument as date.
Mon Mar 03 00:00:00 AST 2008
I can format that to:
but I cannot pass it as a parameter because now it is a string. If I use parse method of Date, it changes back to Mon Mar 03 00:00:00 AST 2008.
Any idea ?
16 years ago
I got date part right, but am having problems with setting the required time as "00:00:00.0000000-05:00"
The instance of Calendar gives me the option of setTime(milliseconds), but there is no option of entering hours, mins, sec, and also the time zone as -05:00.
Secondly, if I have to set number of time and dates, do I need to create as many instances of calendar class? It is looking awkward, I must be wrong.
For example, setting start date, and end date (2 instances)
similarly start time and end time (2 instances)
Need some help here, thanks.
16 years ago
How can we pass a specific time as a parameter to a method ?
For instance if I have to set time to this : "00:00:00.0000000-05:00"

Time wishTime = new Time() ;
wishTime.setTime(long lg) ;
I can't use 00:00:00.0000000-05:00 in setting time as it is expecting long. Is there a way of doing that ?
I have a similar question for date as well. How would you set a specific date, for example "03-03-2008"
Date wishDate = new Date();
wishDate.setDate(int i) ;
I can't use my date here, as it is expecting an integer value.


can I get some help here? thanks
[ March 05, 2008: Message edited by: Nasir Munir ]
16 years ago
can anyone explain what kind of a java for loop is this:

or this one:

I am only familiar with this one:
16 years ago
Date Today = Calendar.getInstance().getTime() ;
my question: I understand one can create an instance of a class, Calendar in this case and then use its method getInstance(). I don't understand .getTime() part ? Can we use call number of methods at the same time ? I understand Calendar.getInstance() part, but cannot understand Calendar.getInstance().getTime() part. Need some help,
16 years ago
are you the one who wrote step by step jakarta - tapestry ? It gives me immense pleasure to know that you are answering my questions.
I am trying to set up tapestry framework at home, and I will try to re-do the whole setup, I hope it should work this time.
At any rate, please update the tapestry installation from version 3.x to 4.x. I liked your article and was very helpful. If you could update that to latest version, that would be great.
Thanks a lot for all your help. Tapestry seems a little complicated, not that I am giving up on it. I hope with more time spent on that, I will be in a better position to understand that well.
Thanks again.
sorry for not explaining my question properly.
Yes I am using the book by Tong.
I have been using this URL to navigate to the page:

The contents of web.xml are:
Tools I am using are:
Tapestry 4.x
Tomcat 5.5.x
Eclipse java europa
I can see tomcat up and running
Now when I am trying to use Tapestry to run Hello World application, I am running into problems. It is perhaps not recognizing the file, as it is showing me page not found error.
Error message:
Document base (the path which I am providing in the context file) does not exist or is not a readable directory.
What I have done so far:
I can see Home.html and and web.xml in the C:\workspace\Hello World\context\WEB-INF. Also the HelloWorld.xml (context file) is there C:\Tomcat\conf\Catalina\localhost. I am following the example from the book and have checked the contents many a time and cannot find any mis-match with that. I have double checked the path in the context file as well and it is telling tomcat to look in the workspace directory for the html page. I can post the file contents if that can make it more clear, but rest assured it is the same as from book.
Can I get some help here?, thanks
here is my send_del() method:

and here is my send mail method:

Can anyone help me figure out the problem ? log file also suggest : illegal address, and then produces the error listed above. I fail to understand, how is running fine with smaller input files and not with larger files. I have tried using negative session time out time, it works but now it is sending an email with the (the size of the file is not right). I can see the size as 109KB on the server, but the attached is just 9KB.
Someone, please help.
[ July 04, 2007: Message edited by: Nasir Munir ]
16 years ago
I have this application running on JBoss 4.0.5.GA.
Big picture is: an input file is split into certain blocks, those blocks are given certain order and are re-combined to form a file again. Then an executable is run on them and results are generated. These results are displayed on a file, and a list is provided to the user to download. If not, the next step would zip those files and send an email to the user as an attachment and then delete the files on the server.
Problem: it works fine, however, with larger files (1GB), it displays the files to download, but on the next step I am getting this error message:

I have checked the log file ( i am using log4j ), and it is showing this error:

I am suspecting it is happneing becuase of session time out, because it is running fine with the smaller files. Can I get some help here ? If I need to post my code here or if I need to explain more, please let me know.
16 years ago
I am not pointing out to a directory. There is a file at the end of that path as "ftn07_i". Please see the code posted above. I am listing the important lines again:

where destFile is :

and j is just a number of the file. Also getUserEmail() and getSessionId() is the input taken from the login form of the application.
I have now created a folder outside the scope of JBoss as suggested earlier. Destination files are now situated at C:/Fastran/user/id/file

If I am creating a download.jsp page, that means I know the files before hand for download purposes. My problem is, I don't know about the file. My application will run and process data and will generate some files(dont know the exact number-depends on the input from the user). Once those files are created, I want them to be presented to the user for review. If the user wants to download them he/she can. If not, then the files will be deleted in the next step.

[ May 24, 2007: Message edited by: Nasir Munir ]

[ May 24, 2007: Message edited by: Nasir Munir ]
[ May 24, 2007: Message edited by: Nasir Munir ]
17 years ago