Swastik Dey wrote:
The
String class has a built in isEmpty method which does exactly the same :). So calling data.trim().isEmpty() should suffice.
@Megha
In pseudo code.
Create a custom object to hold the message and fileName/filePath/fileId/whatever (among other things)
Populate this object and send to client
On the client check if the file related information exists. If no information is available do not show the icon
Create a
servlet. This will accept the fileName/filePath/fileId/whatever and serve the file back to the client.
Invoke this servlet when the user clicks on the icon.
You can search the forums for servlets which can help the client download a file. In case you run into any problem, show us your code, tell us where you are stuck, and we will help point you in the right direction