Skip to Content
avatar image
Former Member

restful web servers提取的提示对象

这种方法提取的提示对象该如何存储SESSION呢?

代码是:

request.setCharacterEncoding("UTF-8");

String boUsername = (String)request.getSession().getAttribute("username");

String boPassword = (String)request.getSession().getAttribute("password");

String[] a = request.getParameter("url").split(" ");

String title = (new String(a[1].getBytes("ISO_8859_1"),"GBK"));

String boAuthType = "secEnterprise";

String reportID = "";

if(a==null){

reportID = "303826";

}else{

reportID = a[0];

}

final String baseURL = http://server:6405/biprws;

final String logonURL = baseURL + "/logon/long";

final String logoffURL = baseURL + "/logoff";

final String baseWebiURL = baseURL + "/raylight/v1/documents";

String Parameter = "";

try{

String xmlString = "";

String documentID = "";

String logonToken = "";

xmlString = "<attrs><attr name=\"userName\" type=\"string\" >"

+boUsername

+"</attr><attr name=\"password\" type=\"string\">"

+boPassword

+"</attr><attr name=\"auth\" type=\"string\" possibilities=\"secEnterprise,secLDAP,secWinAD,secSAPR3\">"

+boAuthType + "</attr></attrs>";

String logonXML = restPost(logonURL,xmlString,"","","","");

logonToken = "\"" + getLogonTokenFromXML(logonXML) + "\"";

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Nov 04, 2015 at 01:10 AM

    是想把logonToken的值放到session里到其他页面使用吗?直接用jsp内置的session对象存可以吗?

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 04, 2015 at 01:15 AM

    不明白你的意思,用getLogonTokenFromXML是从web service的Xml里面提取出logonToken。

    你想要提取什么value?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      BEX报表的query,目前是用BEX报表作为底表,创建WEBI报表,使用JAVA来控制列权限。

  • avatar image
    Former Member
    Nov 04, 2015 at 01:52 AM

    目前是登陆用的TOKEN并保存了SESSION,用户输入账号密码登陆后,整个界面时他权限能看到的所有报表,然后用户点击其中一张报表,就用到上面的代码获得这张报表的提示对象,和我在WEBI创建了代替从BEX继承过来的对象,经过JAVA加工只会显示出我在WEBI创建的对象,输入相关值后,最后获得的是用Opendocument拼接出来的报表。而现在问题是出在每点击一张报表都会新增加2个SESSION,提取提示对象一次,最终的拼接Opendocument又一次,加上最开始的登陆一共3次。

    Add comment
    10|10000 characters needed characters exceeded