JSR 168 Under WebSphere?

If we develop portlets using JSR 168/ WSRP for Plumtree using WebSphere Studio and WebSphere (rather than WebLogic), should they work?
If there were problems that required a Plumtree fix, would such a fix be provided under normal support?
Thanks.

If we develop portlets using JSR 168/ WSRP for Plumtree using WebSphere Studio and WebSphere (rather than WebLogic), should they work?
If there were problems that required a Plumtree fix, would such a fix be provided under normal support?
Thanks.

Similar Messages

  • Error while deploying a JSR 168 portlet developed in JDeveloper 10.1.3.2

    When deploying a JSR 168 portlet created using JDeveloper 10.1.3.2 (Web Center Suite edition), I get the error :
    "Shared library "oracle.wsrp" could not be found."
    Error Log:
    ---- Deployment started. ---- Sep 20, 2007 9:31:42 AM
    Target platform is Oracle Application Server 10g 10.1.3 (PolestarAppServerConnection).
    Wrote WAR file to C:\Projects\eAlliance\JSR168\ViewController\deploy\jsr168.war
    Wrote EAR file to C:\Projects\eAlliance\JSR168\ViewController\deploy\jsr168.ear
    Backing up generic archive file :/C:/Projects/eAlliance/JSR168/ViewController/deploy/jsr168_generic.ear
    Creating WSDLs for the WSRP Application
    WSDLs for the WSRP Application have been created
    Uploading file jsr168.ear ...
    Uploading file jsr168.ear ...
    Application Deployer for jsr168 STARTS.
    Copy the archive to /home/soahome/orasoa/j2ee/home/applications/jsr168.ear
    Initialize /home/soahome/orasoa/j2ee/home/applications/jsr168.ear begins...
    Unpacking jsr168.ear
    Done unpacking jsr168.ear
    Unpacking jsr168.war
    Done unpacking jsr168.war
    Initialize /home/soahome/orasoa/j2ee/home/applications/jsr168.ear ends...
    Starting application : jsr168
    Initializing ClassLoader(s)
    application : jsr168 is in failed state
    Operation failed with error:
    Shared library "oracle.wsrp" could not be found.
    Deployment failed
    Elapsed time for deployment: 39 seconds
    #### Deployment incomplete. #### Sep 20, 2007 9:32:21 AM
    Steps To recreate the error:
    1)Create a new Application in JDeveloper
    2)Click "New" in "ViewController" and click on WebTier->Portlets->Standards based(JSR 168) from the wizard.
    3)Go thru JSR 168 Portlet wizard steps 1 thru' 8 accepting all defaults.
    4)Click "New" in "ViewController" and click on General->Deployment Profiles->WAR File from the wizard.
    5)Enter a name and hit OK. Then in the "WAR Deployment Profile Properties" page, select "Specify J2EE Web Context Root" and enter the name similar to what is in the "Enterprise application name" text box in the same screen. Hit OK.
    6)Right click on the deploy file created under "Resources" and select "Deploy to AppServer" (I am deploying to a remote 10.1.4 Portal Server that has already been configured in my connections tab.
    7)Note the above noted error message in the Deployment Log tab.
    Can you give me any suggestions?
    Thanks,
    Bipin Raj

    Does the \j2ee\home\shared-lib directory contain a directory oracle.wsrp?
    Does the <OC4J_HOME>/j2ee/home/config/server.xml file contain a shared-lib declaration for oracle.wsrp?
    <shared-library name="oracle.wsrp" version="1.0">
    <code-source path="wsrp-container.jar"/>
    <code-source path="wsrp-types.jar"/>
    <code-source path="wsrp-jaxb.jar"/>
    <code-source path="jaxb-api.jar"/>
    <code-source path="jaxb-impl.jar"/>
    <code-source path="jaxb-libs.jar"/>
    <code-source path="namespace.jar"/>
    <code-source path="xsdlib.jar"/>
    <code-source path="relaxngDatatype.jar"/>
    <import-shared-library name="oracle.gdk"/>
    <import-shared-library name="oracle.xml"/>
    <import-shared-library name="oracle.jdbc"/>
    <import-shared-library name="oracle.cache"/>
    </shared-library>

  • Portlet API:  JSR 168 / 286  vs Vendor Extensions

    Currently evaluating Websphere 5.1 vs WebLogic 8.1 Portal software.
    It seems like both IBM and BEA push you towards using their Portal extensions as "value add" features. I am really interested in sticking to JSR 168 for portability.
    Does anyone have any experience with these tools developing JSR 168? I would appreciate your observations about using the vendor extensions vs JSR 168 support in these tools. Please add any comments on other portal software you have had success with.
    Any idea when will JSR 286 come out with final spec?
    Message was edited by:
    java@finance

    sorry.Correction.I am using Oracle portal 10.1.4 .
    -Vid-

  • Consuming web services in a jsr 168 portlet best practices.

    I am building portlets (jsr 168 api in Websphere Portal 6.0 using web service client of Rational). Now needed some suggestions on caching the web services data on the portlet. We have a number of portlets (somewhere around 4 or 5) on a portal page which basically rely on a single wsdl Lotus Domino Web Service.
    Is there a way I can cache the data returned by webservice so that I dont make repeated calls to the webservice on every portlet request. Any best practices/ideas on how I could do avoid multiple web service calls would be appreciated ?

    Interestingly, as it often happens with Oracle portal, this has started working without me doing anything special.
    However, the session events my listener gets notified of are (logically, as this portlet works via WSRP) different from user sessions. The problem I'm trying to solve now is that logging off (in SSO) doesn't lead to those sessions being destroyed. They only get destroyed after timeout specified in my web.xml (<session-config><session-timeout>30</session-timeout></session-config>). On the other hand, when they do expire, the SSO session may still be active, in which case the user gets presented with the infamous "could not get markup" error message. The latter is unacceptable in our case, so we had to set session-timeout to a pretty high value.
    So the question is, how can we track when the user logs off. We have found the portal.wwctx_sso_session$ and portal.WWLOG_ACTIVITY_LOG1$ (and ...2$) tables, but no documentation for them. However, the real problem with using those tables is that there's no way we could think of to match the portlet sessions with SSO sessions/actions listed in the tables. (Consider situation when someone logs in from two PCs.)
    Any ideas?

  • JSR 168 APIs

    Dear All,
    We are trying to get content from IBM Websphere Portal v5.1  and display in our SAP portal . The content in IBM portal is stored in portlets . IBM recommended us to call their JSR 168 API's to just grab the content. We only want the content not the formatting. We cannot use URL iviews as their URL has not only the content but also a navigation panel , and we do not want the navigation panel.
    I believe our Portal EP 7.0 can support JSR 168 compliant API from some of the information   we found in SDN .  But we are not able to locate the any how to guide on how to call such API from SAP whether from ABAP or Java we have no idea. Does anyone have something like a How to guide/ even sample code on how  to call JSR 168 API or how can I proceed with this.
    Best Rgds

    hey you need to set up federated portal network(FPN) to establish this.i had done this before. i you only want webshpere portal content to be displayed in SAP EP, then implementing FPN alone wil do.if you want to dispay the content from SAP EP in IBM websphere then you need to do some coding in portal side to make your application jsr168 compliant
    Message was edited by:
            jeyasingh samuel  Durairaj

  • URL generation - Https and JSR 168

    We have some JSR 168 complaint portlets that are working fine under http. However,
    when we switch to https (with a webserver front-end), the edit button functionality
    generates incorrect urls. It tries to use http and then append port 443. These
    urls do not work with the web server front-end.
    I know all urls for JPF portlets etc are controlled through the url-template-config.xml
    file, but it seems that the JSR 168 portlets do not use this file. Any idea what
    these portlets use and what configuration change I could make to resolve this
    issue?
    Thanks
    Kunal

    Hi Subbu -
    I have modified the template to use relative paths - maybe that will solve my
    issue. Here is my modified template.
    Thanks
    Kunal
    Subbu Allamaraju <[email protected]> wrote:
    Hi Kunal,
    In WLP, all portlets rely on url-templates-config.xml to create URLs.
    The edit button is independent of the type of the portlet you are using.
    For Java portlets, could you make sure you have the following snippet
    in
    this file:
    <java-portlet-url-templates>
    <url-template-ref type="action" name="portlet-default"/>
    <url-template-ref type="secure-action" name="portlet-default"/>
    <url-template-ref type="resource" name="portlet-default"/>
    <url-template-ref type="secure-resource" name="portlet-default"/>
    </java-portlet-url-templates>
    </url-template-config>
    where the name of the template should be mapped to one of the templates
    defined in this file.
    If you still face issues with this, please post the templates specified
    in this file so that I can take a look. Also, let me know if you are
    using GA or SP2.
    Subbu
    Kunal Mittal wrote:
    We have some JSR 168 complaint portlets that are working fine underhttp. However,
    when we switch to https (with a webserver front-end), the edit buttonfunctionality
    generates incorrect urls. It tries to use http and then append port443. These
    urls do not work with the web server front-end.
    I know all urls for JPF portlets etc are controlled through the url-template-config.xml
    file, but it seems that the JSR 168 portlets do not use this file.Any idea what
    these portlets use and what configuration change I could make to resolvethis
    issue?
    Thanks
    Kunal
    [url-template-config.xml]

  • How to deploy existing JSR-168 portlet in WLP 10.0?

    I have a JSR-168 portlet packaged in a .war file and am trying to deploy in WLP 10.0. This seems like a common question that looks to be covered thoroughly for version 8.0 in the link:
    [url http://dev2dev.bea.com/pub/a/2004/09/deployJava81sp3.html]
    Those instructions no longer work, the tool is referencing classes that don't seem to exist in 10.0 and so it won't run.
    I am currently attempting to move the pieces by hand into a new Workshop Web Project, but was hoping that by now there would be an easier way.
    Any suggestions?

    I stumbled across the answer after I had manually merged the portlet into an existing web project. It is actually pretty straight forward.
    1. Right click on the web project, select import.
    2. You will be presented with three options - war file, ear file, import.... The ware war file option is so tempting, but it is not what you want. Choose Import... to get a longer list of options.
    3. Under "Other" you will see "Portlet from Archive".
    This does exactly what I wanted, with the exception of the web.xml. The files are not merged, you can either skip it or overwrite it. Small price to pay for the convenience.

  • How to convert JSR-168 compliant Portlets into SAP iviews

    Hi All,
    Its very urgent requirement for me...
    <b>How to convert JSR-168 compliant Portlets into SAP Enterprise Portal supported iViews in SAP NetWeaver 2004 or 2004s.</b> Can you please tell me any tools are available for conversion or is there any another procedure to achieve this problem.
    At last can we ach
    Each answer will be awarded with points.
    Regards
    Sreedhar G

    Hi Sreedhar,
    Is there anyway to display Standard Business packages content in IBM websphere portal.If there is anyway please let me know.
    thanks,
    Anil

  • JSR-168 Consumer question

    Hi,
    I am new to plumtree portal but have used some other JSR-168 compliant portals such as exo and websphere. I want to reuse some of the portlets I created in plumtree portal. It seems installing the JSR-168 consumer on the portal server and remote server is a good way to achieve that.
    Are there any concerns with installing the JSR-168 consumer on the portal server side? Any performance pennalties, compatibility issue etc? I am going to bring this up to our portal admin once I can get more information regarding it here.
    Thanks
    -Chengmin

    test
    <chengmin ding> wrote in message news:[email protected]..
    Hi,
    I am new to plumtree portal but have used some other JSR-168 compliant
    portals such as exo and websphere. I want to reuse some of the portlets I
    created in plumtree portal. It seems installing the JSR-168 consumer on
    the portal server and remote server is a good way to achieve that.
    Are there any concerns with installing the JSR-168 consumer on the portal
    server side? Any performance pennalties, compatibility issue etc? I am
    going to bring this up to our portal admin once I can get more information
    regarding it here.
    Thanks
    -Chengmin

  • JSR-168/WSRP iViews

    Hi,
    I have the following doubts to be cleared.It would be of great help if someone knows abt these and revert back ASAP.
    1) How many iViews currently exist? Is there a directory of available iViews?
    2) Is SAP planning to provide today's iView functionality as JSR-168/WSRP portlets together with the new release (or later)?
    3) Would it make sense to create JSR-168/WSRP portlets by reusing existing iViews? I.e. is the iView Java code customizable? Would that be a feasible approach in order to provide iView-like functionality through JSR-168 or WSRP portlets?
    4)Any other alternatives to expose iView-like functionality through a non-SAP portal? If so, what would that look like?
    Regards.....

    Hi Christian,
    1) This question is independent of WSRP/JSR, right? --> So, you mean, how many iViews in general.. There is no list published by SAP giving an overview of available iViews. However, you could get a little overview when checking out the business packages currently available offered by SAP and partners.
    https://www.sdn.sap.com/sdn/contentportfolio.sdn
    2) SAP is not planning to provide all the functionality in a JSR168/WSRP-compliant manner. SAP will support WSRP by the end of this year with the next NetWeaver release. However, this does not mean that the existing content will be available via WSRP. Some might be, but to which extent, cannot be said for sure now. JSR is intended to be supported next year, meaning that the NetWeaver Portal will be able to consume JSR168-compliant portlets, but not provide all the existing content in JSR168 format.
    3) You are not allowed to modify iViews delivered by SAP. If you intend to modify iViews, which you created on your own, it depends on how much effort you want to spend on it and how long you can wait with your projects since both standards are not supported at the moment yet with the current SP releases.
    4) Please a bit more specific about what you mean with iView-like functionality. In general, to leverage the full functionality of SAP iViews you always need the full NetWeaver Portal framework. There are some scenarios of how to integrate the SAP EP into the WebSphere Portal. Check out the docs here on SDN.
    Kind regards,
    Thomas

  • JSR-168 Portlets, Plumtree, and IIS

    Is it possible to run JSR-168 portlets with Plumtree under IIS? Has anyone done it, and if so, how?

    If you don't want to use the administration console to create channels based on the porltlets you deployed, you need to create a display profile fragment that create the channels and import using 'dpadmin'

  • JSR 168 Portlets with JSF Content

    Is there any news on the possibility of achieving this.
    Should I go ahead and do it myself using MyFaces and the Apache Portals JSF Bridge?  (or try and leverage the WebSphere JSF tooling using the Apache Portals JSF Bridge)?   Or use the Sun JSF-Portlet Bridge?
    Thanks,
    Don

    Don,There is a JSR-168 / JSF portlet bridge that I tested on our portal a few months ago that worked pretty well. It required a lot of changes to the faces-config.xml file and the addition of a bridge jar. I think it also had some drawbacks in regards to the use of sub-views in a JSF page.If you are not tied to using JSR-168, a better solution might be the new JSF filter, which is similar to what we do with .NET Web controls. It allows JSF applications to run as portlets and refreshes the portlet using in-place-refresh (AJAX). This filter is simple to set up, well documented, and can be found at: http://portal.plumtree.com/portal/server.pt?space=CommunityPage&cached=true&parentname=CommunityPage&parentid=0&in_hi_userid=63776&control=SetCommunity&CommunityID=2758&PageID=5913under the name "Java Portlet Tools".Let me know which solution you are interested in. The JSF / JSR-168 bridge is available from Sun as development source code but you will probably want to use some of the helper classes that I wrote for it. These classes are not publically available, but I can send you a jar if that's what you need.Andy
    ------- Don Brady wrote on 6/2/05 9:11 AM -------Is there any news on the possibility of achieving this.Should I go ahead and do it myself using MyFaces and the Apache Portals JSF Bridge? (or try and leverage the WebSphere JSF tooling using the Apache Portals JSF Bridge)? Or use the Sun JSF-Portlet Bridge?Thanks,Don

  • Integration between portlets using JSR 168

    I've developed 3 portlets but I want them talking with each other, in a way that is JSR 168 compliant.
    For example, I have a search box portlet, where the user can only type search expressions, a search result portlet, where the user will see search results, and a search summary portlet, where the user will see statistics about search.
    First question: how can I send data from one portlet to another? Is HttpSession a safe place to share data between portlets? Can I trust that all containers will create a single HttpSession per user?
    Second question: how can one portlet force refresh of another, or even hide or show up another portlet?

    Well it is a very smart question..
    To be more precise i don't think it is been properly answered with
    JSR 168 specification.
    However,there few best practises followed in order to achieve it.
    The idea of using HttpSession (PortletSession.getHttpSession() with Usage of AJAX) as you said it certainly one of the things which evryone would think.
    http://www.ibm.com/developerworks/websphere/library/techarticles/0604_scott/0604_scott.html
    http://www.doc.ic.ac.uk/~mo197/portlets/portlet_messaging/
    http://wiki.java.net/bin/view/Portlet/JSR168FAQ(checkout the last part of the document)
    http://www.michaelgilfix.com/techblog/2007/01/27/ajax-and-portlets
    http://www.theserverside.com/news/thread.tss?thread_id=35385
    http://blogs.jboss.com/blog/jviet/2005/07/14/The_recurring_interportlet_communication_dilemna.txt
    http://portlets.blogspot.com/2005/07/inter-portlet-communication-library.html
    http://docs.sun.com/app/docs/doc/819-5942/6n807tpc2?a=view
    http://www.oracle.com/technology/products/ias/portal/pdf/oow06_S281756_jsr168ajax.pdf
    http://docs.jboss.org/jbportal/v2.2/reference-guide/en/html/ipc.html#d0e1308
    However,SUN is trying to revise it in their next specification JSR 286.
    http://jcp.org/en/jsr/detail?id=286,
    http://blogs.sun.com/nav/entry/understanding_portlet_2_0_jsr1,
    http://apachecon.com/2006/US/presentations/FR8/FR8-JSR-286-updated.pdf
    Second Question:how can one portlet force refresh >of another, or even hide or show up another portlet?As discussed earlier Usage of AJAX / (And storing Common Credentials in a Bean which scoped to HttpSession) in the dependent portlet would be quite handy in the above discussed case.
    Hope this might help :)
    REGARDS,
    RaHuL

  • JSR 168 Portlet Filter

    Hi ! I am trying to apply a filter to jsr 168 portlet in its web.xml file. Is it possible to add a filter like that to jsr 168 portlet. Any help will be very much appreciated.
    Thanks

    if you are using websphere you can go outside og the portlet spec.
    http://publib.boulder.ibm.com/infocenter/wp51help/index.jsp?topic=/com.ibm.wp.ent.doc/wps/adpltflt.html

  • We can use JSR-168 JPS portlet upload file,

    We can use JSR-168 JPS portlet upload file,
    here is the source for you referrence:
    upload file can use JSR168 portlet,
    1,CustomizablePortlet.java File
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.ResourceBundle;
    import javax.portlet.*;
    import oracle.webdb.utils.SimpleStringBuffer;
    public class CustomizablePortlet extends GenericPortlet {
    private static final String TITLE_KEY = "title";
    protected static final String OK_ACTION = "ok_action";
    protected static final String APPLY_ACTION = "apply_action";
    protected static final PortletMode PREVIEW_MODE = new PortletMode("preview");
    protected static final PortletMode EDIT_DEFAULTS_MODE = new PortletMode("EDIT_DEFAULTS");
    protected static final PortletMode ABOUT_MODE = new PortletMode("ABOUT");
    public CustomizablePortlet() {
    public String getTitle(RenderRequest request) {
    return request.getPreferences().getValue("title", getPortletConfig().getResourceBundle(request.getLocale()).getString("javax.portlet.title"));
    public void doEdit(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.print("<FORM ACTION=\"");
    out.print(getEditFormSubmitURL(request, response));
    out.println("\" METHOD=\"POST\">");
    out.println("<TABLE BORDER=\"0\">");
    out.println("<TR>");
    out.println("<TD WIDTH=\"20%\">");
    out.println("<P CLASS=\"portlet-form-field\" ALIGN=\"RIGHT\">Title:");
    out.println("</TD>");
    out.println("<TD WIDTH=\"80%\">");
    out.print("<INPUT CLASS=\"portlet-form-input-field\" TYPE=\"TEXT\" NAME=\"");
    out.print("title");
    out.print("\" VALUE=\"");
    out.print(getTitle(request));
    out.println("\" SIZE=\"20\">");
    out.println("</TD>");
    out.println("</TR>");
    out.println("<TR>");
    out.println("<TD COLSPAN=\"2\" ALIGN=\"CENTER\">");
    out.print("<INPUT CLASS=\"portlet-form-button\" TYPE=\"SUBMIT\" NAME=\"");
    out.print("ok_action");
    out.print("\" VALUE=\"OK\">");
    out.print("<INPUT CLASS=\"portlet-form-button\" TYPE=\"SUBMIT\" NAME=\"");
    out.print("apply_action");
    out.print("\" VALUE=\"Apply\">");
    out.println("</TD>");
    out.println("</TR>");
    out.println("</TABLE>");
    out.println("</FORM>");
    protected String getEditFormSubmitURL(RenderRequest request, RenderResponse response) {
    return response.createActionURL().toString();
    public void doHelp(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.print("Help for <i><b>");
    out.print(getTitle(request));
    out.println("</b></i>.");
    public void doAbout(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    String aboutHTML = (new SimpleStringBuffer(30)).append("/about_").append(getPortletName()).append(".html").toString();
    PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(aboutHTML);
    response.setContentType("text/html");
    if(rd != null) {
    rd.include(request, response);
    } else {
    PrintWriter out = response.getWriter();
    out.print("<p class=\"portlet-font\">This is the about page for ");
    out.print(getTitle(request));
    out.print(".</p><p class=\"portlet-font\">");
    out.print("To customize the contents of this page, create a file named '");
    out.print(aboutHTML.substring(1));
    out.print("' in the Portlet web application's root directory containing HTML ");
    out.print("to appear here. ");
    out.print("Alternatively, override the <code>CustomizablePortlet</code> ");
    out.println("class's <code>doAbout()</code> method.</p>");
    public void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    WindowState state = request.getWindowState();
    if(!state.equals(WindowState.MINIMIZED)) {
    PortletMode mode = request.getPortletMode();
    if(mode.equals(PREVIEW_MODE))
    doView(request, response);
    else
    if(mode.equals(EDIT_DEFAULTS_MODE))
    doEdit(request, response);
    else
    if(mode.equals(ABOUT_MODE))
    doAbout(request, response);
    else
    super.doDispatch(request, response);
    } else {
    super.doDispatch(request, response);
    public void processAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException {
    String newTitle = request.getParameter("title");
    PortletPreferences prefs = request.getPreferences();
    prefs.setValue("title", newTitle);
    prefs.store();
    if(request.getParameter("ok_action") != null) {
    actionResponse.setPortletMode(PortletMode.VIEW);
    actionResponse.setWindowState(WindowState.NORMAL);
    2,FileUploadPortlet.java file
    import java.io.*;
    import javax.activation.DataHandler;
    import javax.mail.MessagingException;
    import javax.mail.internet.MimeBodyPart;
    import javax.portlet.*;
    import oracle.portal.portlet.sample.CustomizablePortlet;
    public class FileUploadPortlet extends CustomizablePortlet
    private static final String FILE_PARAM = "file";
    private static final String SUBMIT_PARAM = "submit";
    private static final String DEFAULT_CHARSET = "ISO-8859-1";
    private static final String uploadRoot = "";
    public FileUploadPortlet()
    public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.print("<form action=\"");
    out.print(response.createActionURL().toString());
    out.println("\" enctype=\"multipart/form-data\" method=\"post\">");
    out.println("<center><table border=\"0\">");
    out.println("<tr>");
    out.print("<td class=\"portlet-form-field\" align=\"right\">");
    out.print("Please browse to an HTML file:");
    out.println("</td>");
    out.print("<td>");
    out.print("<input class=\"portlet-form-input-field\" type=\"file\" name=\"");
    out.print("file");
    out.print("\">");
    out.println("</td>");
    out.println("</tr>");
    out.println("<tr>");
    out.println("<td colspan=\"2\" align=\"center\">");
    out.print("<input type=\"submit\" class=\"portlet-form-button\" name=\"");
    out.print("submit");
    out.print("\" value=\"Display\">");
    out.println("</td>");
    out.println("</tr>");
    out.println("</table>");
    out.println("</form>");
    String lastFile = request.getPreferences().getValue("file", null);
    if(lastFile != null) {
    out.println("<hr width=\"100%\"><br>");
    out.print(lastFile);
    public void processAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException {
    FormDataParser parsedRequest = new FormDataParser(request);
    MimeBodyPart mbp = parsedRequest.getMimeBodyPart("file");
    if(mbp == null)
    super.processAction(request, actionResponse);
    else
    try {
    String fileName= mbp.getFileName();
    int splash = fileName.lastIndexOf("\\");
    if(splash != -1)
    fileName = fileName.substring(splash +1, fileName.length()).trim();
    String contentType = mbp.getContentType();
    String charSet = getCharsetFromContentType(contentType);
    int sepIndex = contentType.indexOf(';');
    if(sepIndex != -1)
    contentType = contentType.substring(0, sepIndex).trim();
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    mbp.getDataHandler().writeTo(bos);
    bos.close();
    String content = new String(bos.toByteArray(), charSet);
    FileOutputStream fos = new FileOutputStream(fileName);
    fos.write(bos.toByteArray());
    fos.close();
    PortletPreferences prefs = request.getPreferences();
    prefs.setValue("file", fileName + "upload ok");
    prefs.store();
    catch(MessagingException me) {
    throw new PortletException(me);
    public static String getCharsetFromContentType(String contentType) {
    int lastPos;
    if((lastPos = contentType.indexOf(';')) == -1)
    return "ISO-8859-1";
    lastPos++;
    String lowerContentType = contentType.toLowerCase();
    int nextPos;
    do {
    nextPos = lowerContentType.indexOf(';', lastPos);
    String param;
    if(nextPos == -1)
    param = lowerContentType.substring(lastPos).trim();
    else
    param = lowerContentType.substring(lastPos, nextPos).trim();
    if(param.startsWith("charset=") && param.length() > 8)
    return param.substring(8);
    lastPos = nextPos + 1;
    } while(nextPos != -1);
    return "ISO-8859-1";
    3,FormDataParser.java file
    import java.io.*;
    import java.util.*;
    import javax.activation.DataSource;
    import javax.mail.MessagingException;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMultipart;
    import javax.portlet.ActionRequest;
    import javax.portlet.PortletException;
    public class FormDataParser {
    private static final String MULTIPART_PREFIX = "multipart/";
    private static final String MULTIPART_FORM_DATA = "multipart/form-data";
    private static final String PLAIN_TEXT = "text/plain";
    private ActionRequest mWrappedRequest;
    private Map mParams;
    private Map mBodyParts;
    private boolean mIsInitialized;
    private boolean mHasMultipart;
    public FormDataParser(ActionRequest request) {
    mWrappedRequest = request;
    public String getParameter(String name) throws PortletException {
    String value = mWrappedRequest.getParameter(name);
    if(value != null)
    return value;
    initParameters();
    if(!mHasMultipart)
    return null;
    List paramList = (List)mParams.get(name);
    if(paramList != null)
    return (String)paramList.get(0);
    else
    return null;
    public String[] getParameterValues(String name) throws PortletException {
    String values[] = mWrappedRequest.getParameterValues(name);
    if(!mHasMultipart)
    return values;
    initParameters();
    List valueList = (List)mParams.get(name);
    if(valueList == null)
    return values;
    int size = valueList.size();
    if(values != null) {
    List newValueList = new ArrayList(values.length + size);
    newValueList.addAll(Arrays.asList(values));
    newValueList.addAll(valueList);
    valueList = newValueList;
    values = new String[size];
    valueList.toArray(values);
    return values;
    public MimeBodyPart getMimeBodyPart(String name) throws PortletException {
    initParameters();
    if(!mHasMultipart) {
    return null;
    } else {
    List parts = (List)mBodyParts.get(name);
    return parts != null ? (MimeBodyPart)parts.get(0) : null;
    public MimeBodyPart[] getMimeBodyParts(String name) throws PortletException {
    initParameters();
    if(!mHasMultipart)
    return null;
    List parts = (List)mBodyParts.get(name);
    if(parts == null) {
    return null;
    } else {
    MimeBodyPart mimeBodyParts[] = new MimeBodyPart[parts.size()];
    parts.toArray(mimeBodyParts);
    return mimeBodyParts;
    private void initParameters() throws PortletException {
    if(mIsInitialized)
    return;
    String contentType = mWrappedRequest.getContentType();
    if(contentType == null) {
    mIsInitialized = true;
    return;
    int sepIndex = contentType.indexOf(';');
    if(sepIndex != -1)
    contentType = contentType.substring(0, sepIndex).trim();
    if(contentType.equalsIgnoreCase("multipart/form-data")) {
    mParams = new HashMap(20);
    mBodyParts = new HashMap(20);
    DataSource ds = new DataSource() {
    public InputStream getInputStream() throws IOException {
    return mWrappedRequest.getPortletInputStream();
    public OutputStream getOutputStream() throws IOException {
    throw new IOException("OutputStream not available");
    public String getContentType() {
    return mWrappedRequest.getContentType();
    public String getName() {
    return getClass().getName();
    try {
    MimeMultipart multipartMessage = new MimeMultipart(ds);
    parseMultiPart(multipartMessage, null);
    catch(MessagingException me) {
    throw new PortletException(me);
    catch(IOException ioe) {
    throw new PortletException(ioe);
    mHasMultipart = true;
    mIsInitialized = true;
    private void parseMultiPart(MimeMultipart multipartMessage, String parentFieldName) throws MessagingException, IOException {
    int partCount = multipartMessage.getCount();
    for(int i = 0; i < partCount; i++) {
    javax.mail.BodyPart part = multipartMessage.getBodyPart(i);
    if(part instanceof MimeBodyPart) {
    MimeBodyPart mimePart = (MimeBodyPart)part;
    String disps[] = mimePart.getHeader("Content-Disposition");
    if(disps != null && disps.length != 0) {
    String disp = disps[0];
    String lcDisp = disp.toLowerCase();
    int nameStart;
    int nameEnd;
    if((nameStart = lcDisp.indexOf("name=\"")) != -1 && (nameEnd = lcDisp.indexOf("\"", nameStart + 6)) != -1)
    parentFieldName = disp.substring(nameStart + 6, nameEnd);
    if(parentFieldName != null)
    if(mimePart.getContentType().toLowerCase().startsWith("multipart/")) {
    Object content = mimePart.getContent();
    if(content instanceof MimeMultipart)
    parseMultiPart((MimeMultipart)content, parentFieldName);
    } else
    if((nameStart = lcDisp.indexOf("filename=\"")) != -1 && (nameEnd = lcDisp.indexOf("\"", nameStart + 10)) != -1) {
    List values = (List)mBodyParts.get(parentFieldName);
    if(values == null) {
    values = new ArrayList(1);
    mBodyParts.put(parentFieldName, values);
    values.add(mimePart);
    } else
    if(mimePart.getContentType().toLowerCase().startsWith("text/plain")) {
    Object content = mimePart.getContent();
    if(content instanceof String) {
    List values = (List)mParams.get(parentFieldName);
    if(values == null) {
    values = new ArrayList(1);
    mParams.put(parentFieldName, values);
    values.add((String)content);
    4.web.xml file
    <?xml version = '1.0' encoding = 'ISO-8859-1'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>hanhuiwen OracleSamplePortlets</display-name>
    <description>hanhuiwen Oracle Sample Portlet Application</description>
    <servlet>
    <servlet-name>portletdeploy</servlet-name>
    <servlet-class>oracle.webdb.wsrp.server.deploy.PortletDeployServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>portletjaxrpc</servlet-name>
    <servlet-class>com.sun.xml.rpc.server.http.JAXRPCServlet</servlet-class>
    <init-param>
    <param-name>configuration.file</param-name>
    <param-value>/WEB-INF/WSRPService_Config.properties</param-value>
    </init-param>
    </servlet>
    <servlet>
    <servlet-name>portletresource</servlet-name>
    <servlet-class>oracle.webdb.wsrp.server.ResourceServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>ChartServlet</servlet-name>
    <display-name>Chart Servlet</display-name>
    <description>Demo image-generating servlet</description>
    <servlet-class>oracle.portal.portlet.sample.chart.ChartServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>uix</servlet-name>
    <servlet-class>oracle.cabo.servlet.UIXServlet</servlet-class>
    <init-param>
    <param-name>oracle.cabo.servlet.pageBroker</param-name>
    <param-value>oracle.cabo.servlet.xml.UIXPageBroker</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>ChartServlet</servlet-name>
    <url-pattern>/chart*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>portletjaxrpc</servlet-name>
    <url-pattern>/portlets*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>portletresource</servlet-name>
    <url-pattern>/portletresource*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>uix</servlet-name>
    <url-pattern>*.uix</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>uix</servlet-name>
    <url-pattern>/uix/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>60</session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>index.uix</welcome-file>
    </welcome-file-list>
    <!--
    LogLevel controls the amount of information logged. There are 7 log levels:
    0 - logging disabled
    1 - configuration
    2 - severe error
    3 - warning
    4 - throwing exception
    5 - performance
    6 - information
    7 - debug
    The oracle.portal.log.Logger interface defines methods that map to these 7
    log levels. However, there are also 2 methods that do not map to log
    levels. These methods are included for backwards compatibility and data
    logged using these methods will always be logged regardless of the log level.
    -->
    <env-entry>
    <env-entry-name>oracle/portal/log/logLevel</env-entry-name>
    <env-entry-type>java.lang.Integer</env-entry-type>
    <env-entry-value>7</env-entry-value>
    </env-entry>
    </web-app>
    5.portlet.xml
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
    <portlet>
    <description xml:lang="en">A portlet that demonstrates the file upload features of the Java Portlet Specification.</description>
    <portlet-name>FileUpload</portlet-name>
    <portlet-class>FileUploadPortlet</portlet-class>
    <expiration-cache>0</expiration-cache>
    <supports>
    <mime-type>text/html</mime-type>
    <portlet-mode>help</portlet-mode>
    <portlet-mode>about</portlet-mode>
    <portlet-mode>edit_defaults</portlet-mode>
    </supports>
    <supported-locale>en</supported-locale>
    <portlet-info>
    <title>File Upload Portlet</title>
    <short-title>File Upload</short-title>
    <keywords>File,Upload, Portlet</keywords>
    </portlet-info>
    </portlet>
    <custom-portlet-mode>
    <description xml:lang="en">This mode should be used by the portlet to display information on the portlet's purpose, origin, version, etc.</description>
    <portlet-mode>about</portlet-mode>
    </custom-portlet-mode>
    <custom-portlet-mode>
    <description xml:lang="en">This mode signifies that the portlet should render a screen to set the default values for the modifiable preferences that are typically changed in the EDIT screen. Calling this mode requires that the user must have administrator rights.</description>
    <portlet-mode>edit_defaults</portlet-mode>
    </custom-portlet-mode>
    <custom-portlet-mode>
    <description xml:lang="en">This mode should be used by the portlet to render output without the need of having back-end connections or user specific data available.</description>
    <portlet-mode>preview</portlet-mode>
    </custom-portlet-mode>
    <user-attribute>
    <name>user.name.given</name>
    </user-attribute>
    <user-attribute>
    <name>user.name.family</name>
    </user-attribute>
    <user-attribute>
    <name>user.name.middle</name>
    </user-attribute>
    <user-attribute>
    <name>user.name.nickname</name>
    </user-attribute>
    <user-attribute>
    <name>user.bdate</name>
    </user-attribute>
    <user-attribute>
    <name>user.business-info.online.email</name>
    </user-attribute>
    </portlet-app>

    Hello i had exactly the same error, but not with file upload.
    I'm sure you have in your application lib directory to jars which aren't compatible to each other.
    And the problem occured between my myfaces and tomahawk jars .
    See this page:
    http://wiki.apache.org/myfaces/CompatibilityMatrix
    It tells you which myfaces and tomahawk jars you can use together.
    Hope it can help.
    bye

Maybe you are looking for

  • Want to replace stock HDD with a 256GB SSD, have questions.

    Hi All, I am sure this has been asked a bunch of times, so forgive me if I ask again... I have a late 2010 MBP (Model A1278).  Currently the machine has 4gb of memory and a 256gb hard drive on it.  The machine is starting to show its age and is slowi

  • Upgrading fails. lightdm-webkit-greeter conflict

    I tried to upgrade my system: sudo pacman -Suu :: Starting full system upgrade... :: Replace dirmngr with core/gnupg? [Y/n] :: Replace font-misc-ethiopic with extra/xorg-fonts-misc? [Y/n] :: Replace gst-vaapi with extra/gstreamer-vaapi? [Y/n] :: Repl

  • Static Verse Non-Static Methods

    Let say I was going to write a class that contained methods to do the same thing as itoa() and atoi() functions in C. What would be the pros and cons of making those methods static verses non-static?

  • Live Pro- program not responding

    Since I purchased my web cab on the 26th, it was working great. On the 29th, all of a sudden, the program will not respond. I have tried to uninstall it and reinstall it but that did not work. Any suggestions?

  • Mac os x 10.4.11 tiger

    Ive just bought this mac in germany, brand new but software was already installed so everything was in German, when i got back i configered the computer settings, region, time and date to all US which is the settings i want but still there are some G