将参数传递给网址

时间:2015-04-24 03:57:21

标签: java javascript jsp jax-rs

我通过jax-rs端点调用jsp页面,如下所示。

 public String logout(@Context HttpServletRequest request,@DefaultValue("Empty Details") @QueryParam("logoutNotification") String logoutNotification,
                     @QueryParam("id_token_hint") String id_token_hint) {
     Response response=    Response.status(200).entity(logoutNotification).build();
    if(response.getEntity().toString().equals("True")){
       return "<html><head><script>\n" +
              "window.open(\"https://localhost:9443/carbon/authenticationendpoint/test.jsp\");</script></head><body></body></html>";
    }
   else {
       return null;
    }

问题是我需要将一些参数传递给&#39; https://localhost:9443/carbon/authenticationendpoint/test.jsp&#39;从这个端点。我该怎么做? 我可以从端点传递它作为查询参数吗?请指教。 感谢

1 个答案:

答案 0 :(得分:1)

我对RESTful Web服务不太了解。但是在一个网址中,如果你想传递参数,它就可以<url URL>?par1=val1&par2=val2完成。如果你的代码打开一个新窗口,那么这将有效。

我希望这对你有所帮助。

示例:https://localhost:9443/carbon/authenticationendpoint/test.jsp?name=Joe&age=24

相关问题