saradhasivaraman Posted October 15, 2012 Share Posted October 15, 2012 Hi ,I have used serlvet to direct the jasper chart to Browser... Here is the snippet for the same...web.xml <servlet> <servlet-name>webreport</servlet-name> <servlet-class> net.ensode.jasperbook.HtmlReportServlet </servlet-class> </servlet> <servlet> <servlet-name>ImageServlet</servlet-name> <servlet-class> net.sf.jasperreports.j2ee.servlets.ImageServlet </servlet-class> </servlet> <servlet-mapping> <servlet-name>webreport</servlet-name> <url-pattern>/webreport</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ImageServlet</servlet-name> <url-pattern>/image</url-pattern> </servlet-mapping> and I use JRHtmlExporter in my HtmlReportServlet class to direct it to the browser JRHtmlExporter htmlExporter = new JRHtmlExporter(); response.setContentType("text/html"); request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_ PRINT_SESSION_ATTRIBUTE, jasperPrint); htmlExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); htmlExporter.setParameter(JRExporterParameter.OUTPUT_WRITER, printWriter); htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?image="); htmlExporter.exportReport(); I face the problem while deploying the weblogic sever... It throws runtime classnotfound exception net.sf.jasperreports.j2ee.servlets.ImageServlet net.sf.jasperreports.j2ee.servlets.ImageServlet this class is avialable under the jar jasper reports 4.5 <servlet-class> net.sf.jasperreports.j2ee.servlets.ImageServlet </servlet-class> Can U Guys plz help me.. Link to comment Share on other sites More sharing options...
saradhasivaraman Posted October 16, 2012 Author Share Posted October 16, 2012 HI... It has been resovled... jst try to make ur class file( net.sf.jasperreports.j2ee.servlets.ImageServlet) avialable in the build/classes folder and clean and deploy the weblogic server..Since the web.xml searches for the corresponding class file in the build/classed folder. Link to comment Share on other sites More sharing options...
marianol Posted October 17, 2012 Share Posted October 17, 2012 Thanks for posting the solution!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now