This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSP and the fly likes How to write code in jsp and hide it from the user Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "How to write code in jsp and hide it from the user" Watch "How to write code in jsp and hide it from the user" New topic
Author

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

prathamesh bandivadekar
Ranch Hand

Joined: May 22, 2008
Posts: 43
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.


Prathamesh M.B.<br />Java....only.....
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30597
    
154

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
prathamesh bandivadekar
Ranch Hand

Joined: May 22, 2008
Posts: 43
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to write code in jsp and hide it from the user