Hey, I have written a program in jsp which calls an external java program and requests for the creation of a text file as follows
index.jsp <%@ page import="java.io.*" %>
<jsp:useBean id="blogs3" scope="session" class="blogs.Q3" />
<%= blogs3.doit() %><br>
public static String doit()throws Exception
p = new PrintStream(out);
ab.append("adfdfdsdfdsfdsf fsdfsfsfsfsfsfdsffdfddfsdfs dffsdfssfsdfdsfbrcd");
This program above gives output as
But does not create a myfile.txt file.Please Help
The Q3 programm when individually compiled using javac creates the file very well. But does not works with jsp.
p s Shetty
Joined: Dec 28, 2012
Hey, friends I have been trying to solve this problem from the last 4 days. But finally just after posting this i got the solution.
just a small editing in the Q3 made it possible
i just changed this line
public static String a = "C:/Program Files/Java/myfile.html";
Well just include the whole file path.