Quantcast

[jira] Created: (WW-3094) http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] Created: (WW-3094) http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation

JIRA jira@apache.org
http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation
----------------------------------------------------------------------------------------

                 Key: WW-3094
                 URL: https://issues.apache.org/struts/browse/WW-3094
             Project: Struts 2
          Issue Type: Bug
         Environment: http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation
            Reporter: Martin Gainty


http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html doc does'nt accomodate getRealPath
try {
            JasperCompileManager.compileReportToFile(
                    "S2_WEBAPP/jasper/our_jasper_template.jrxml",
                    "S2_WEBAPP/jasper/our_compiled_template.jasper");
        } catch (Exception e) {
            e.printStackTrace();
            return ERROR;

instead of  "S2_WEBAPP/jasper/our_jasper_template.jrxml"

should be:
StringBuffer sb=ServletActionContext.getServletContext().getRealPath("S2_WEBAPP");
//then just tack on your jrxml filename
path1=sb.append("/jasper/scrounger_report.jrxml").toString();
//then just tack on your our_compiled_template.jasper
path2=sb.append("/jasper/our_compiled_template.jasper").toString();

try {
            JasperCompileManager.compileReportToFile(
                   path1,
                   path2;
        } catch (Exception e) {
            e.printStackTrace();
            return ERROR;

HTH
MCG 21 April 2009

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] Updated: (WW-3094) http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation

JIRA jira@apache.org

     [ https://issues.apache.org/struts/browse/WW-3094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Newton updated WW-3094:
----------------------------

    Component/s: Documentation

> http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation
> ----------------------------------------------------------------------------------------
>
>                 Key: WW-3094
>                 URL: https://issues.apache.org/struts/browse/WW-3094
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>         Environment: http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation
>            Reporter: Martin Gainty
>
> http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html doc does'nt accomodate getRealPath
> try {
>             JasperCompileManager.compileReportToFile(
>                     "S2_WEBAPP/jasper/our_jasper_template.jrxml",
>                     "S2_WEBAPP/jasper/our_compiled_template.jasper");
>         } catch (Exception e) {
>             e.printStackTrace();
>             return ERROR;
> instead of  "S2_WEBAPP/jasper/our_jasper_template.jrxml"
> should be:
> StringBuffer sb=ServletActionContext.getServletContext().getRealPath("S2_WEBAPP");
> //then just tack on your jrxml filename
> path1=sb.append("/jasper/scrounger_report.jrxml").toString();
> //then just tack on your our_compiled_template.jasper
> path2=sb.append("/jasper/our_compiled_template.jasper").toString();
> try {
>             JasperCompileManager.compileReportToFile(
>                    path1,
>                    path2;
>         } catch (Exception e) {
>             e.printStackTrace();
>             return ERROR;
> HTH
> MCG 21 April 2009

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] Updated: (WW-3094) http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/struts/browse/WW-3094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Newton updated WW-3094:
----------------------------

    Priority: Minor  (was: Major)

> http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation
> ----------------------------------------------------------------------------------------
>
>                 Key: WW-3094
>                 URL: https://issues.apache.org/struts/browse/WW-3094
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>         Environment: http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation
>            Reporter: Martin Gainty
>            Priority: Minor
>
> http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html doc does'nt accomodate getRealPath
> try {
>             JasperCompileManager.compileReportToFile(
>                     "S2_WEBAPP/jasper/our_jasper_template.jrxml",
>                     "S2_WEBAPP/jasper/our_compiled_template.jasper");
>         } catch (Exception e) {
>             e.printStackTrace();
>             return ERROR;
> instead of  "S2_WEBAPP/jasper/our_jasper_template.jrxml"
> should be:
> StringBuffer sb=ServletActionContext.getServletContext().getRealPath("S2_WEBAPP");
> //then just tack on your jrxml filename
> path1=sb.append("/jasper/scrounger_report.jrxml").toString();
> //then just tack on your our_compiled_template.jasper
> path2=sb.append("/jasper/our_compiled_template.jasper").toString();
> try {
>             JasperCompileManager.compileReportToFile(
>                    path1,
>                    path2;
>         } catch (Exception e) {
>             e.printStackTrace();
>             return ERROR;
> HTH
> MCG 21 April 2009

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] Commented: (WW-3094) http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/struts/browse/WW-3094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46080#action_46080 ]

Dave Newton commented on WW-3094:
---------------------------------

StringBuilder, getRealPath("/"), double-append will concatenate filenames for path2. No reason to use a StringBuffer/Builder for two concats; IIRC the tradeoff comes after ~6+ concats.

> http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation
> ----------------------------------------------------------------------------------------
>
>                 Key: WW-3094
>                 URL: https://issues.apache.org/struts/browse/WW-3094
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>         Environment: http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation
>            Reporter: Martin Gainty
>            Priority: Minor
>
> http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html doc does'nt accomodate getRealPath
> try {
>             JasperCompileManager.compileReportToFile(
>                     "S2_WEBAPP/jasper/our_jasper_template.jrxml",
>                     "S2_WEBAPP/jasper/our_compiled_template.jasper");
>         } catch (Exception e) {
>             e.printStackTrace();
>             return ERROR;
> instead of  "S2_WEBAPP/jasper/our_jasper_template.jrxml"
> should be:
> StringBuffer sb=ServletActionContext.getServletContext().getRealPath("S2_WEBAPP");
> //then just tack on your jrxml filename
> path1=sb.append("/jasper/scrounger_report.jrxml").toString();
> //then just tack on your our_compiled_template.jasper
> path2=sb.append("/jasper/our_compiled_template.jasper").toString();
> try {
>             JasperCompileManager.compileReportToFile(
>                    path1,
>                    path2;
>         } catch (Exception e) {
>             e.printStackTrace();
>             return ERROR;
> HTH
> MCG 21 April 2009

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] Closed: (WW-3094) http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/struts/browse/WW-3094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wes Wannemacher closed WW-3094.
-------------------------------

    Resolution: Won't Fix

This is a doc change request (I think?), and I think the docs are currently readable and that optimization is unnecessary. If someone were extremely concerned with optimization, they would know to make the necessary changes before copying/pasting code out of a tutorial.

> http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation
> ----------------------------------------------------------------------------------------
>
>                 Key: WW-3094
>                 URL: https://issues.apache.org/struts/browse/WW-3094
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>         Environment: http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html has wrong documentation
>            Reporter: Martin Gainty
>            Priority: Minor
>
> http://struts.apache.org/2.0.14/docs/jasperreports-tutorial.html doc does'nt accomodate getRealPath
> try {
>             JasperCompileManager.compileReportToFile(
>                     "S2_WEBAPP/jasper/our_jasper_template.jrxml",
>                     "S2_WEBAPP/jasper/our_compiled_template.jasper");
>         } catch (Exception e) {
>             e.printStackTrace();
>             return ERROR;
> instead of  "S2_WEBAPP/jasper/our_jasper_template.jrxml"
> should be:
> StringBuffer sb=ServletActionContext.getServletContext().getRealPath("S2_WEBAPP");
> //then just tack on your jrxml filename
> path1=sb.append("/jasper/scrounger_report.jrxml").toString();
> //then just tack on your our_compiled_template.jasper
> path2=sb.append("/jasper/our_compiled_template.jasper").toString();
> try {
>             JasperCompileManager.compileReportToFile(
>                    path1,
>                    path2;
>         } catch (Exception e) {
>             e.printStackTrace();
>             return ERROR;
> HTH
> MCG 21 April 2009

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Loading...