【问题标题】:JAVA(org.tinyradius) method addAttribute (org.tinyradius) on processing "Class" attributeJAVA(org.tinyradius)方法addAttribute(org.tinyradius)处理“类”属性
【发布时间】:2018-04-03 09:37:05
【问题描述】:
RadiusClient rc = new RadiusClient("xx.xx.xx.xx","0000");
AccountingRequest acc = new AccountingRequest("michael",AccountingRequest.ACCT_STATUS_TYPE_START); 
acc.addAttribute("Framed-IP-Address", "1.1.1.1");
acc.addAttribute("Class","Key CL: PT=C");
rc.account(acc);
rc.close(); 

我尝试通过创建上面的 jsp 页面向我的记帐服务器发送记帐请求。

但是,只有

 acc.addAttribute("Framed-IP-Address", "1.1.1.1")
可以接受,使用
 acc 发送25号属性类型“Class”时出错。 addAttribute("Class","Key CL: PT=C")
哪里出错了?!

【问题讨论】:

  • 异常错误显示“无法将属性25的值设置为字符串”,但是方法addAttribute只接受(字符串,字符串)

标签: java jsp tinyradius


【解决方案1】:

终于找到答案了,属性“Class”,需要通过方法添加:

    acc.addAttribute(new StringAttribute(25,"Key CL: PT=C"));

【讨论】:

    猜你喜欢
    • 2015-04-26
    • 1970-01-01
    • 2021-09-29
    • 2010-09-20
    • 2018-04-28
    • 2018-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多