Ratish Vichithran

Greenhorn
+ Follow
since Feb 27, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Ratish Vichithran

Ok let me put it this way. How will I show a pdf to the user and also adhere to security?
16 years ago
Hi Bear Bibeault. Thanks for the reply...

But is there any way to avoid a Cache and also show a pdf using Content-Disposition as inline? . Because it is a security concern. Any other user using the work station can easily access the previous persons data.
16 years ago
My application shows payslips of employees. So when a user click on a link it generates the pdf for which I have added the following code,



But the problem here is that, it creates a PDF in the temporary folder.

Is there a way to delete the cache after the browser showing the pdf is closed?

I tried deactivating cache with the following code,



but it gave me an error saying the file could not be downloaded.


16 years ago
My application shows payslips of employees. So when a user click on a link it generates the pdf for which I have added the following code,



But the problem here is that, it creates a PDF in the temporary folder.

Is there a way to delete the cache after the browser showing the pdf is closed?

I tried deactivating cache with the following code,



but it gave me an error saying the file could not be downloaded.


16 years ago
It still didn't work.

But that's fine. I found a work around.

I created a class with a static method and the parameters to the method are the locale, date value and the format. And I called that method in my jsp.

Now it is working fine...

Thanks for your replies Sagar.
16 years ago
hi Sagar, thanks for the reply

I used the following code,



but still it doesn't work.

I believe I don't have to use bundle since I have no values that are stored in the MessageResources file that has to be used here.

16 years ago
I have to display a date in the format 'MMMM dd, yyyy'. This works only when the locale carries 'en' as the language. It shows English names for months even though the locale has been changed to French, Canada.

The following is the code I have written in my jsp.



I am changing the locale in the session with the attribute named under Globals.LOCALE_KEY.


I read under the struts tag reference the following comment,

If format attribute exists then value will be formatted on base of format string from format attribute and default system locale.



What does default system locale mean, is it the locale of the OS?
16 years ago
Hi Sagar,
Thanks for the reply.

But my problem is various jsps call the same action Download.do. Each jsp needs a different set of data that has to be downloaded so I make use of a 'status' request parameter added to the query string (for eg. Download.do?status=E). The value of status varies.

So based on the status value when I don't get any records, I wante to return back an alert message which has to appear before all jsps and the screen state at the background shdn't change.

I hope I am clear this time around.
16 years ago
In my application there are several buttons in various pages which does the same functionality of downloading records into an excel file.
All requests for download go to Download.do?status=X where X varies. Now based on X the data present in the HttpSession object is filtered and is written into an excel.

If in case there is no data existing in the HttpSession object after filtering is applied then I was thinking about showing an alert box which will inform that there are no records to be downloaded.

I have written the below code to achieve that.

if(details.isEmpty()){
response.setContentType("text/html");
PrintWriter pw = new PrintWriter(response.getOutputStream());
pw.write("<script type=\"text/javascript\" >" +
"alert('There are no records to be downloaded')" +
"</script>");
pw.close();
return null;
}

But the problem with this is that, the screen which was previously available goes blank and only the alert pop-up is shown. I want the previous screen to be as it is and only the alert box to appear. As in case of an excel which comes as an attachment on setting the ContentDisposition
header attribute in HttpServletResponse

can anyone please help me on how I will have to achieve this?

16 years ago