跟OSWorkflow奋斗一天- -| 回首页 | 2004年索引 | - -OSWorkflow真灵活

BeanShell的中文问题- -

                                      

在XML文件中写这么一段BeanShell:
 
String status = getStatus();       // 通过某种途径得到状态
System.out.println(status);       // 这里输出“未提交”
System.out.println(status.indexOf("未提交"));
 
最后一句就得到了-1。
 
System.out.println("未提交");
 
这句直接就得到了乱码。这到底是XML解析器的问题呢还是BeanShell的问题呢?搞不拎清……再试一下去。
 
试过了,在Java里面写:
 
  Interpreter i = new Interpreter();
  i.setClassLoader(getClass().getClassLoader());
  i.eval("System.out.println(\"中文\");");
 
输出乱码。果然是BeanShell的问题。

原来是BeanShell版本的问题,1.2就不支持中文,换成2.0就搞定了。现在我的工作流配置是这个样子:

      <actions>
        <action id="1201" name="认领年检报告书">
          <restrict-to>
            <conditions type="AND">
              <condition type="beanshell" name="bsh.condition">
                <arg name="script">
                 com.opensymphony.workflow.util.beanshell.WorkflowStatus.isStatus(transientVars, "未认领");
                </arg>        
              </condition>
            </conditions>
          </restrict-to>
          <results>
            <unconditional-result old-status="Finished" status="认领未初审" step="12" owner="${ycheckId}" />
          </results>
        </action>

好漂亮哦!

- 作者: gigix 2004年04月8日, 星期四 14:56

Trackback

你可以使用这个链接引用该篇日志 http://publishblog.blogdriver.com/blog/tb.b?diaryID=108228

博客手拉手

回复

- 评论人:xlukwfsf

Thu May 17 01:26:49 CST 2007  作者邮箱  作者Blog

umxwxwmeru[url=http://zvore.yi.org/82177478.html]brazilian pussy[/url][url=http://xenggi.66ghz.com/46330167.html]gun games[/url][url=http://wxaxw.22web.net/34298878.html]tatoo designs[/url][url=http://www32.websamba.com/viora/94041272.html]model com[/url][url=http://uenvc.22web.net/16709694.html]football games[/url][url=http://ninfrb.yi.org/20352297.html]blades glory cam xvid mvs[/url]

评论内容: