Jump to content

struts 2/ jasper reports/ tomcat


spunog

Recommended Posts

I am using Jasper reports with Struts 2 and tomcat 6. I have followed the example to get the sample jasper report working with struts. Everything is fine up until the action looks for the template file. According to the example you should place your template file as follows :

try {
            JasperCompileManager.compileReportToFile(
                    "S2_WEBAPP/jasper/our_jasper_template.jrxml",
                    "S2_WEBAPP/jasper/our_compiled_template.jasper");

So I take this to mean in my /webapps/mywebapp/jasper/our_jasper_template.jrxml

If I use servletcontext.getRealPAth("S2_WEBAPP/jasper/our_jasper_template.jrxml");

It finds the jrxml file but I get this error :
 
java.lang.ClassNotFoundException: org.apache.commons.lang.xwork.StringUtils
Please note the xwork package here. This class (in this package) is not shipped with JAsper Reports 3.5.2
 
I would really like to use Jasper Reports in my project but I am stuck now.
 
Any suggestions are welcome.
 
Thanks in advance
 
Spunog
 
 
 
 
Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...

You need to get your hands on the source code of the plugin. Create a project with this source code in Eclipse. You will need to add the required libs to get it compiling correctly. Make your change in the plugin. Get the new .class file you just created. UnJar  your plugin to some location. replace the .class file with your new one from the project you just created. create the plugin jar again using the same folder structure but with your new .class file. Add this new jar into your webapps lib folder.

 

Thats it !

Link to comment
Share on other sites

  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...