[JBoss Seam] - Transient conversation data
by bdillon
Hi,
I am using Seam with RichFaces. I am currently running into an issue where Seam tries to serialise the richfaces SelectionRange object (held on the SimpleSelection object).
Is there anyway in Seam to mark something as transient data so that it does not get serialised on the conversation ? I have tries using;
private transient SimpleSelection selection;
But still get the following exception;
java.io.NotSerializableException: org.richfaces.model.selection.SelectionRange
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at java.util.ArrayList.writeObject(ArrayList.java:569)
Any help on this would be appreciated,
Thanks,
Brian
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4109911#4109911
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4109911
18 years, 4 months
[JBoss Seam] - Re: Download binary files
by MSchmidke
Hummm.
I removed the things I do not understand (as mentioned, beginRequest and endRequest). With this, I was able to remove BypassInterceptors, and without BypassInterceptors I can have injected my hibernate session.
At the first sight, it works perfectly. Of course, I don't know if I am breaking something in the interns of seam or if I am creating memory leaks or whatever.
| @Startup
| @Scope(ScopeType.APPLICATION)
| @Name("dateidownload")
| public class Dateidownload extends AbstractResource {
| @In
| Session session;
|
| @Override
| public void getResource(HttpServletRequest request,
| HttpServletResponse response) throws ServletException, IOException {
| // ServletLifecycle.beginRequest(request);
| try {
| String id = request.getQueryString();
| Anhang_Dokument ad = (Anhang_Dokument) session.get(
| Anhang_Dokument.class, Long.parseLong(id));
| if (ad == null)
| throw new ObjectNotFoundException(id);
| response.setHeader("Cache-Control", "no-store");
| response.setHeader("Pragma", "no-cache");
| response.setDateHeader("Expires", 0);
| response.setContentType(ad.getDatei().getMimeType());
| response.getOutputStream().write(ad.getDatei().getDaten());
| response.getOutputStream().flush();
| response.getOutputStream().close();
| } catch (Exception e) {
| response.sendError(HttpServletResponse.SC_NOT_FOUND);
| return;
| } finally {
| // ServletLifecycle.endRequest(request);
| }
| }
|
| @Override
| public String getResourcePath() {
| return "/download";
| }
|
| }
|
There are other things in CaptchaImage I don't understand, for example the meaning of @Startup and @Install together. But as told before, I simply deleted things I did not understand, and for the moment, it works ...
Marcus.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4109888#4109888
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4109888
18 years, 4 months