• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to browse and read a file in my jsp page so that later i can perform encryption for that file?  RSS feed

 
Muneera Mujawar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
I am trying to create a file browse option in my jsp and later after browsing, all i want to do is to read that file in my jsp without saving it into that database so that i can perform encryption for it and save that encrypted file later into my database.
Please provide reference link so that i can refer to some applications and and move ahead with my work.

Thanks & Regards
Rizwana
 
Chris Barrett
Bartender
Posts: 321
24
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Muneera,

That sure sounds like a lot of work for one JSP page - especially since the little guy is really just good at presentation.

You may want to think a bit more about the overall design.
Why do you feel having the JSP do all that is a good idea? How are you planning to test?

Cheers!
Chris
 
Muneera Mujawar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi chriss...
As I am a beginner i am working using jsp page. I can break my model into different jsp page. But i need brief idea about how to browse and read a file in jsp...
Like...

browse to open "hello.txt". When i click ok then that corresponding file should be there in my jsp file as:
String file = "hello.txt"

Thanks & Regards
Rizwana
 
Dave Tolls
Rancher
Posts: 2914
36
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a beginner (and some may disagree with me) you should really be working with Servlets first.
They are the heavy lifting arm of this whole thing.

Because at the moment you are making exactly the sort of mistake that comes from working in JSPs first, before learning how the technology hangs together.
It's not your JSP that will be browsing for a file. It's the client browser.
All the JSP is is another kind of servlet, and is executed solely on the server.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Absolutely agree with Dave. Work with servlets first until you understand the servlet life cycle and the way to use the objects which the servlet container creates.

JSP may look easier but is full of pitfalls and traps for the unwary. You will eventually need servlets for any serious work so start right.

Bill
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!