You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Foong Kim Seong <ks...@mimos.my> on 2008/02/26 11:47:59 UTC
Portlet : Display Image & Calling Servlet
Dear all, I understand this user list is for JetSpeed setup but I really
need some hand from you guys on the development.
I am experience java web engineer and not portlet development engineer
thus I am stuck in this basis web navigation.
I have 2 JSP page. JSP1 is basically a entry page and I have a file
upload file to upload an image. In processAction(), I am able to store
the image into database. After that, I will show the JSP2 as a
confirmation page for user to confirm the entry from JSP1. Here is my
problems:
1. In JSP2, I am wish to retrieve the image file from database(in
this scenario). I am wondering how can I do that? I am very happy If
you have better ideas to show the image file that I have selected from
JSP1 to JSP2.
2. I plan to include a servlet invoke in JSP2 and that servlet is
going to retrieve it for me and display as a <IMG SRC> tag. But I have
tried 2 days and still didn't get it work. I understand I can invoke the
servlet like the code below but I am more interested to call it from JSP
Page.
PortletRequestDispatcher dispatcher = getPortletContext()
.getRequestDispatcher("/WEB-INF/jsp/confirmation page.jsp");
dispatcher.include(request, response);
Please share me your ideas.
Thank You.
Regards,
FOONG
------------------------------------------------------------------
-
-
DISCLAIMER:
This e-mail (including any attachments) may contain confidential information.
If you are not the intended recipient, you are hereby notified that any dealing,
review, distribution, printing, copying or use of this e-mail is strictly prohibited.
If you have received this email in error, please notify the sender or MIMOS Berhad
immediately and delete the original message. Opinions, conclusions and other
information in this e-mail that do not relate to the official business of MIMOS Berhad
and/or its subsidiaries shall be understood as neither given nor endorsed by MIMOS
Berhad and/or its subsidiaries and neither MIMOS Berhad nor its subsidiaries accepts
responsibility for the same. All liability arising from or in connection with computer
viruses and/or corrupted e-mails is excluded to the fullest extent permitted by law.
Re: Portlet : Display Image & Calling Servlet
Posted by Stefano Bianchi <st...@softeco.it>.
Dear Foong,
my two cents on how I solved similar problems for JSP and jetpseed (I am not
portlet development engineer too, and the solution is really losely coupled
with Jetspeed I guess).
If you use JSPportlet, then I suggest to have a single JSP which makes
dynamic inlcudes of other JSP according to request parameters.
For example, in a single MasterJSP.jsp you might have
...
if (request.getAttribute("upload").equals("Y"))
[include SuccessJSP.jsp]
else
[inlcude ErrorJSP.jsp]
Consider that in SuccessJSP.jsp you might have all the code you need, e.g.
to load the image from the db.
Hope it helps,
see how it works e.g. at www.euroworksafe.eu
The content browse functionality works like that.
Cheers & good luck
Stefano
----- Original Message -----
From: "Foong Kim Seong" <ks...@mimos.my>
To: "Jetspeed Users List" <je...@portals.apache.org>
Sent: Tuesday, February 26, 2008 11:47 AM
Subject: Portlet : Display Image & Calling Servlet
Dear all, I understand this user list is for JetSpeed setup but I really
need some hand from you guys on the development.
I am experience java web engineer and not portlet development engineer
thus I am stuck in this basis web navigation.
I have 2 JSP page. JSP1 is basically a entry page and I have a file
upload file to upload an image. In processAction(), I am able to store
the image into database. After that, I will show the JSP2 as a
confirmation page for user to confirm the entry from JSP1. Here is my
problems:
1. In JSP2, I am wish to retrieve the image file from database(in
this scenario). I am wondering how can I do that? I am very happy If
you have better ideas to show the image file that I have selected from
JSP1 to JSP2.
2. I plan to include a servlet invoke in JSP2 and that servlet is
going to retrieve it for me and display as a <IMG SRC> tag. But I have
tried 2 days and still didn't get it work. I understand I can invoke the
servlet like the code below but I am more interested to call it from JSP
Page.
PortletRequestDispatcher dispatcher = getPortletContext()
.getRequestDispatcher("/WEB-INF/jsp/confirmation page.jsp");
dispatcher.include(request, response);
Please share me your ideas.
Thank You.
Regards,
FOONG
------------------------------------------------------------------
-
-
DISCLAIMER:
This e-mail (including any attachments) may contain confidential
information.
If you are not the intended recipient, you are hereby notified that any
dealing,
review, distribution, printing, copying or use of this e-mail is strictly
prohibited.
If you have received this email in error, please notify the sender or MIMOS
Berhad
immediately and delete the original message. Opinions, conclusions and other
information in this e-mail that do not relate to the official business of
MIMOS Berhad
and/or its subsidiaries shall be understood as neither given nor endorsed by
MIMOS
Berhad and/or its subsidiaries and neither MIMOS Berhad nor its subsidiaries
accepts
responsibility for the same. All liability arising from or in connection
with computer
viruses and/or corrupted e-mails is excluded to the fullest extent permitted
by law.
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org