Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write code in jsp and hide it from the user

 
prathamesh bandivadekar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In my application i have to save data in to the pdf file.

The code to generate the pdf file i have written in the javabean.

when i run the application the file get saved at the server side and not at the user side.

so my question is whether we can write a code in jsp and still hide it from the user or can we send a file object on the wire and reference it at the user side. Then store the file on the user side.

One more question..

How to bring "Save As" dialog box in JSP. I had done this once using executeCommand() method in javascript.

But it has only two file types..
1> HTML
2> .txt

Can you please guide me in this regard or give any link,suggestion?

Thanks in Adavance.
Pratham.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't hide HTML code from the user. The JSP should be protected against readers.

You should set the MIME type and "attachment" in the header of your JSP/Servlet to get the desired type.
 
prathamesh bandivadekar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to get "Save As" dialod box in jsp?

I got one using executeCommand("Save As", X, Y);

But when the window opens it gives only two options for saving..
1> save as "HTML"
2> save as "*.txt"

How to add more file types?

Please guyz help me!!!


Thanks in adavance,
Pratham.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic