• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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: 40747
827
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.
 
My, my, aren't you a big fella. Here, have a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic