admin管理员组文章数量:1130349
我这里用的是下载的360极速浏览器,因为这款浏览器在关闭最后一个标签页的时候浏览器也会默认自动关闭的(不行的话就自己在设置里设置),
我这里是用Java代码运行CMD命令打开网页的,想要关闭浏览器也可以使用CMD命令
/**
* 请求的地址也可以带参数
* @param caseNo
* @param clid
* @param servid
*/
@ResponseStatus(HttpStatus.OK)
@RequestMapping(value="/gpy/liangtian",method = RequestMethod.GET)
public void liangtian(@RequestParam(value="caseNo",required=false) String caseNo,
@RequestParam(value="clid",required=false) String clid ,
@RequestParam(value="servid",required=false) String servid){
String url= "10.235.11.135:1037/mas/gpy/gpy?caseNoAndClid="+caseNo+"-"+clid+"-"+servid;
//360急速浏览器,设置为关闭最后一个标签页关闭浏览器
String str = "cmd /c start D:/tools/360/360Chrome/Chrome/Application/360chrome.exe --kiosk "+url;
try {
Runtime.getRuntime().exec(str);
} catch (IOException e) {
e.printStackTrace();
}
}
这是代码导入的工具包,先放一下吧,防止大家导错包
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import com.vingsoft.hsi.config.GetPropertiesConfig;
import java.io.IOException;
import java.util.Map;
我这里用的是下载的360极速浏览器,因为这款浏览器在关闭最后一个标签页的时候浏览器也会默认自动关闭的(不行的话就自己在设置里设置),
我这里是用Java代码运行CMD命令打开网页的,想要关闭浏览器也可以使用CMD命令
/**
* 请求的地址也可以带参数
* @param caseNo
* @param clid
* @param servid
*/
@ResponseStatus(HttpStatus.OK)
@RequestMapping(value="/gpy/liangtian",method = RequestMethod.GET)
public void liangtian(@RequestParam(value="caseNo",required=false) String caseNo,
@RequestParam(value="clid",required=false) String clid ,
@RequestParam(value="servid",required=false) String servid){
String url= "10.235.11.135:1037/mas/gpy/gpy?caseNoAndClid="+caseNo+"-"+clid+"-"+servid;
//360急速浏览器,设置为关闭最后一个标签页关闭浏览器
String str = "cmd /c start D:/tools/360/360Chrome/Chrome/Application/360chrome.exe --kiosk "+url;
try {
Runtime.getRuntime().exec(str);
} catch (IOException e) {
e.printStackTrace();
}
}
这是代码导入的工具包,先放一下吧,防止大家导错包
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import com.vingsoft.hsi.config.GetPropertiesConfig;
import java.io.IOException;
import java.util.Map;
版权声明:本文标题:java用特定浏览器打开网址 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/jiaocheng/1760095145a2847270.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论