I have a problem when I desplay the process in jsp I use the following code:
public ArrayList<String> getProcessusList(){
ArrayList<String> ss=new ArrayList<String>();
String st="";
try {
String line;
Process p = Runtime.getRuntime().exec
(System.getenv("windir") +"\\system32\\"+"tasklist.exe");
BufferedReader input =
new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
String[] se=line.split(" =\n");
for(String sd:se){ss.add(sd);}
}
input.close();
} catch (Exception err) {
err.printStackTrace();
}
return ss;
}
and in jsp file the code is:
<body>
ArrayList <String>processArray=p.getProcessusList();
<%for(String se:processArray){
String []s=se.split(" ");
for(String sd:s){%><%=sd %> <% }%> <br><% } %>
</body>
Output:
but I want to a format more user friendly,can you help me?