繁体   English   中英

将参数传递给网址

[英]Passing parameters to a url

我正在通过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;
    }

问题是我需要从此端点将一些参数传递给“ https:// localhost:9443 / carbon / authenticationendpoint / test.jsp ”。 我该怎么做? 我可以将其作为来自端点的queryparam传递吗? 请给我建议。 谢谢

我对RESTful Web服务不了解很多。 但是在URL中,如果要传递参数,可以按<url URL>?par1=val1&par2=val2如果您的代码打开一个新窗口,则此方法有效。

希望对您有帮助。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM