java - jsp小脚本在前端不输出怎么解决
PHP中文网
PHP中文网 2017-04-17 16:22:05
[Java讨论组]
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="java.io.BufferedReader"%>
<%@page import="java.io.InputStreamReader"%>
<%@page import="java.io.IOException"%>
<%@page import="java.io.File"%>
<%@page import="java.io.FileInputStream"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>My JSP 'index.jsp' starting page</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
  </head>
  <body>
    <% 
         String s = null;
        String file="shoes10059.stl";
        try {     
        // run the Unix "slic3r —load config_m2.ini  xxxx.stl" command
            // using the Runtime exec method:
            Process p = Runtime.getRuntime().exec("C:/Program Files (x86)/Slic3r/slic3r-console --load D:/m2/config_m2.ini"+" "+"D:/m2/"+file+"> D:/m2/log.tex");
             
            BufferedReader stdInput = new BufferedReader(new
                 InputStreamReader(p.getInputStream()));
 
            BufferedReader stdError = new BufferedReader(new
                 InputStreamReader(p.getErrorStream()));
 
            // read the output from the command
           out.println("Here is the standard output of the command:\n");
            while ((s = stdInput.readLine()) != null) {
             out.println(s);
            } 
            // read any errors from the attempted command
         out.println("Here is the standard error of the command (if any):\n");
            while ((s = stdError.readLine()) != null) {
               out.println(s);
            }
             
            System.exit(0);
        }
        catch (IOException e) {
         out.println("exception happened - here's what I know: ");
        
            e.printStackTrace();
            System.exit(-1);
        }
    %>
  </body>
</html>

这个jsp执行完前端没输出。后台显示结果是

怎么解决????在线等!!

PHP中文网
PHP中文网

认证高级PHP讲师

全部回复(0)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号