Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Can Mondrian parse JSP inside a query tag?

  1. #1
    Join Date
    May 2003
    Posts
    15

    Default Can Mondrian parse JSP inside a query tag?

    We are receiving errors when trying to run the following code snippet in our query...
    <%@ page session="true" contentType="text/html; charset=ISO-8859-1" %>
    <%@ taglib uri="
    http://www.tonbeller.com/jpivot/mondrian
    " prefix="mondrian" %>
    <jsp:useBean id="loginHandler" class="com.LoginBean" scope="session"/>
    <mondrian:query id="query01"
    jdbcDriver="oracle.jdbc.driver.OracleDriver"
    jdbcUrl="jdbcracle:thin:@servre:1521B"
    jdbcUser= "<%= loginHandler.getUsername() %>"
    jdbcPassword= "<%= loginHandler.getPassword() %>"
    catalogUri="/WEB-INF/queries/DataMine.xml">
    Our errors come when trying to call the Bean for the jdbcUser and jdbcPassword. Is this the correct syntax to do this or must the username/password be hard coded?
    Thanks.
    P.S. We know LoginBean works properly because we are using it on another application in much the same manner.

  2. #2
    Join Date
    Nov 1999
    Posts
    1,618

    Default RE: Can Mondrian parse JSP inside a query tag?

    Hmm, I'm not an expert on JSP, but it seems like it should work. Take a look at the Java file generated by the JSP compiler and see if it looks reasonable. You could also try assigning loginHandler.getUsername() and loginHandler.getPassword() to a local variable just before invoking the <mondrian:query/> tag.

  3. #3
    Join Date
    May 2003
    Posts
    15

    Default RE: Can Mondrian parse JSP inside a query tag?

    I've tried the following code but it still does not work. It is as if Mondrian doesn't let the JSP compile what is in the query tags. The java line created by the JSP is:
    _jspx_th_partrader_query_0.setJdbcDriver("<%= driver %>");
    This should be the actual driver name, not the jsp code <%= driver %>.
    Here's the code I'm running (Don't pay attention to the user and password attributes on this one, I'm just testing the driver name):
    <%
    System.out.println("I'm printing from the jsp query!!"); //this works
    String driver = "oracle.jdbc.driver.OracleDriver";
    %>
    <mondrian:query id="query01" jdbcDriver='<%= driver %>' jdbcUrl="jdbcracle:thin:@server:1521B" jdbcUser="user" jdbcPassword="password" catalogUri="/WEB-INF/queries/mondrian.xml">
    And the error:
    com.tonbeller.jpivot.olap.model.OlapException: Could not load Jdbc Driver <%= driver %>
    at com.tonbeller.jpivot.mondrian.MondrianModel.getResult(MondrianModel.java:88)
    at com.tonbeller.jpivot.olap.model.OlapModelDecorator.getResult(OlapModelDecorator.java:34)
    at com.tonbeller.jpivot.olap.model.CachingOlapModel.getResult(CachingOlapModel.java:36)
    at com.tonbeller.jpivot.olap.model.OlapModelDecorator.getResult(OlapModelDecorator.java:34)
    at com.tonbeller.jpivot.table.TableComponent.render2(TableComponent.java:151)

  4. #4
    Join Date
    May 2003
    Posts
    15

    Default RE: Can Mondrian parse JSP inside a query tag?

    Disregard the last post. We were able to achieve what we needed by rewriting the MondrianOlapModelTag.java file and calling our LoginBean.java file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.