[JBoss Seam] - Downloading the PDF , XLS file.
by m.shinde
Hi,
I am getting stuck while downloading the PDF , XLS file.
Actually I am able to download the files but I think facesCtx.responseComplete(); is not working properly.
If I click to download PDF it downloads properly. After that If I click to download XLS file it is again calling PDF Download process and then XLS.
Means my request object is not completed, it is still forwared to new process.
I am using JSF-SEAM-EJB3.0
And JBoss 4.2.1 GA.
Below is my code.
| if (type.equals("pdf")) {
| response.setContentType("application/pdf");
| design.setIgnorePagination(false);
| exporter = new JRPdfExporter();
| exporter.setParameter(JRExporterParameter.JASPER_PRINT,
| print);
| exporter.setParameter(JRExporterParameter.OUTPUT_STREAM,
| response.getOutputStream());
| }else {
| response.setContentType("application/vnd.ms-excel");
| design.setIgnorePagination(true);
| byte[] bytes = null;
| ServletOutputStream ouputStream = response.getOutputStream();
| ByteArrayOutputStream xlsReport = new ByteArrayOutputStream();
| JExcelApiExporter jExcelApiExporter = new JExcelApiExporter();
| jExcelApiExporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
| jExcelApiExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, showType);
| jExcelApiExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
| jExcelApiExporter.exportReport();
| }
|
| exporter.exportReport();
|
| // Tell JavaServer Faces that no output is required
| facesCtx.responseComplete();
|
Please suggest Where I am doing wrong. OR Do I need to follow other process.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079116#4079116
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079116
18Â years, 7Â months
[Microcontainer] - Re: How do I programmatically declare a JNDI name dependency
by alesj
| /**
| * JNDI aware KernelRegistryPlugin.
| *
| * @author <a href="mailto:ales.justin@gmail.com">Ales Justin</a>
| */
| public class JNDIKernelRegistryPlugin implements KernelRegistryPlugin
| {
| private Hashtable properties;
| private Context context;
|
| public void setProperties(Hashtable properties)
| {
| this.properties = properties;
| }
|
| public void create() throws NamingException
| {
| if (properties != null)
| context = new InitialContext(properties);
| else
| context = new InitialContext();
| }
|
| public void destroy() throws NamingException
| {
| if (context != null)
| context.close();
| context = null;
| }
|
| public KernelRegistryEntry getEntry(Object name)
| {
| try
| {
| Object target = context.lookup(name.toString());
| return new AbstractKernelRegistryEntry(name, target);
| }
| catch (NamingException e)
| {
| }
| return null;
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079108#4079108
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079108
18Â years, 7Â months
[JBoss Messaging] - Problem with destination's name using slash
by hendra_netm
Hi guys,
Currently, I am using JBoss 1.3.0.GA with JBoss 4.2.0
I get strange behavior when using slash in queue name.
For example this queue name: /var/spool/test
will generate this exception: javax.naming.NameNotFoundException: spool not bound
| <mbean code="org.jboss.jms.server.destination.QueueService"
|
| name="jboss.messaging.destination:service=Queue,name=/var/spool/test"
|
| xmbean-dd="xmdesc/Queue-xmbean.xml">
|
| <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
|
| <depends>jboss.messaging:service=PostOffice</depends>
|
| </mbean>
|
|
Fortunately, you can bound such name using server peer's deploy queue method.
Is this a bug? Or there is a rule about destination's name that forbids such kind of name?
Thank you for your attention.
Best Regards,
Hendra
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079107#4079107
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079107
18Â years, 7Â months