-
1. Re: problem with creating MediaOutput in javabean
nbelaevski Jul 1, 2009 1:20 PM (in response to orkun)Hi,
First check what's rendered on the page (is there IMG tag, does it have "uri" attribute, etc.). If it's ok, then this method should render resource contents: org.ajax4jsf.resource.UserResource.send(ResourceContext) - you can set breakpoint there and check what's wrong. -
2. Re: problem with creating MediaOutput in javabean
orkun Jul 2, 2009 4:25 AM (in response to orkun)thank you
So, there is no problem java code above ? -
3. Re: problem with creating MediaOutput in javabean
nbelaevski Jul 2, 2009 6:40 AM (in response to orkun)Yes, code looks ok by quick inspection, but I haven't tried to run it.
-
4. Re: problem with creating MediaOutput in javabean
orkun Jul 2, 2009 12:41 PM (in response to orkun)
hello
I am sorry to extend the question.
Nothing is displayed. But I get null exception as:
javax.servlet.ServletException: Required attribute element for component harita:fotoBean is null.
Isn't my java code to view the image
MethodExpression mediaMethodExpression = expressionFactory.createMethodExpression(elContext,
"#{haritaBean1.drawFoto}",
null,
new Class[] {OutputStream.class,Object.class} );
---------------
drawFoto works statically.
public void drawFoto(OutputStream output, Object object) {
System.out.println(" I am in drawFoto---------------");
try {
if (getFoto_byte().length > 0) {
System.out.println("draw foto ");
System.out.println("------------------------");
output.write(getFoto_byte());
output.flush();
} else {
System.out.println("getFoto_byte().length : "
+ getFoto_byte().length);
}
output.close();
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println("**ORKUN ***" + "fotoda da sıkıntı var");
e.printStackTrace();
}
} -
5. Re: problem with creating MediaOutput in javabean
nbelaevski Jul 2, 2009 1:15 PM (in response to orkun)Ok, looks like you have to add setElement() call.
-
6. Re: problem with creating MediaOutput in javabean
orkun Jul 2, 2009 2:51 PM (in response to orkun)THANKS A LOT
--------------------
It works