dcsimg
Reading and writng files in jsp w/out using BufferedReader or PrintWriter
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mike_Monark
Posted On:   Thursday, September 19, 2002 04:16 PM

Here's my problem. I just published my website to a new web hoster that does support jsp/tomcat. However, they do not know anything about the setup, etc. I tried to run my jsp (which read and writes to files) but got permission errors, as the java.policy file is not set up to correctly (I think) to read my local .java.policy file where I gave myself permissions to read/write the file. I've given up on receiving support, but would like to stay with them as they are quite cheap (unless someone has another suggestion?). So, I have a few options: 1) Find a new web hoster that can provide jsp support 2) Figure out a way in my jsp to grant read/write permission to the file    More>>

Here's my problem. I just published my website to a new web hoster that does support jsp/tomcat. However, they do not know anything about the setup, etc. I tried to run my jsp (which read and writes to files) but got permission errors, as the java.policy file is not set up to correctly (I think) to read my local .java.policy file where I gave myself permissions to read/write the file. I've given up on receiving support, but would like to stay with them as they are quite cheap (unless someone has another suggestion?).



So, I have a few options:



1) Find a new web hoster that can provide jsp support



2) Figure out a way in my jsp to grant read/write permission to the file in the directory. Is this possible? Maybe by using the file.io class?



3) Try to read/write my files using perl via cgi and keep the guts of my program the same



4) Use MySQL to store my data



5) Rewrite in Perl



Any suggestions for option 1 and 2 would be great. For option 3, I have an idea of what to do. I don't really want to deal with option 4 and 5, as I have never used MySQL or programmed in PERL that much.



For option 3, to write the data, I was going to write some code to create a huge form with all of the data, and then pass it to a perl program which would parse and write to the file.



However, I am unsure how to read the file and then pass it to the jsp so it can store the data in the object for processing. Is this possible?



I am stummped. Any ideas on this or other ways to solve my problem would be great! Also, if you have a suggestion for a different web hoster (that can help with this sort of jsp problem), please let me know. I just joined my current web hoster and can get my money back within 30 days.



Thanks in advance!



Mike

mike_monark@hotmail.com

   <<Less

Re: Reading and writng files in jsp w/out using BufferedReader or PrintWriter

Posted By:   Christopher_Schultz  
Posted On:   Friday, September 20, 2002 06:16 AM

What kind of data do you have?



Generally, a database is better than the disk for data storage. And, if you plan to move to EJB at some point, you are essentially forbidden to use the java.io package to read and write to the filesystem.



Using MySQL is not hard at all. If you know basic SQL, you can get by. You'll probably have to have your web provider set up the MySQL account for you, so you'll not have to deal with that.



Hope that helps,

-chris

Re: Reading and writng files in jsp w/out using BufferedReader or PrintWriter

Posted By:   Jeanne_Boyarsky  
Posted On:   Thursday, September 19, 2002 06:24 PM

You might want to try rewriting the JSP as a servlet.


Sometimes you get more permissions with servlets because it is compiled in your user directory.
About | Sitemap | Contact