Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Executing a unix command from a jsp page

 
Tex Abrey
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to change permissions on a file from a jsp page here's my code.....
Runtime rt = Runtime.getRuntime();
rt.exec("chmod 444 " + absDIR + year + mon + pdfName);
I get know errors with this code but it does not work.
I can't seem to figure it out
thanks
Tex
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
exec creates a process - to see any errors generated by that process, you would have to look at the error stream or output stream from that process. I suggest you experiment with the code in a "bean" that you can test outside the JSP environment - it will be much easier to see what is going on.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic