• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic