2 Replies Latest reply on Jul 13, 2005 10:38 AM by Tomasz Szymanski

    POST in jsr168 portlets

    Tomasz Szymanski Novice

      Hello,

      I'm trying to make JSPWiki become a portlet. As JSPWiki is written whole in JSP i did simple portlet that is a part of JSPWiki.war and includes .jsp pages in it.

      To do that i did simple servlet filter, to change all hrefs from for example

      /Wiki.jsp?page=MyCoolPage

      to
      http://localhost:8080/portal/index.html?ctrl:id=page.with.wiki&page=Wiki.jsp&par0=page&val0=MyCoolPage

      after that, my portlet decodes it to JSPWiki href and includes apropriate page.

      My problem is that all posts doesn't work (while submiting some data). I changed action="..." the same way, but unfortunately page just reloads and nothing posts (like wiki pages which is quite important in Wiki ;) ).

      Can anybody think out why it is not working and is there any way to make it work ?

      cheers,
      Tomasz Szymanski

        • 1. Re: POST in jsr168 portlets
          Woodler Expert

          the issue is that the portlet can't "see" the posted data unless it is posted as part of a render or action request targeted to this particular portlet.

          In other words: the action="post-url-here" must be an action URL in the sense of a portlet action url , so add that token to the URL and it should work.
          I'm more than alarmed, however, about the way you did this. It would be much cleaner and less error prone if the portlet itself could take over the URL manipulation, since it is the only instance that knows how to form correct URLs ....

          • 2. Re: POST in jsr168 portlets
            Tomasz Szymanski Novice

            If I got your solution right i had to add 'ctrl:type=action' to action url, right ? If yes... it is not working :/

            I even tried to add 'ctrl:type=render' to the urls to be able to get parameters by request.getParameter()... but it is not working. It's very strange, because i remember doing this in he past and parameters were accesible.

            Maybe it is something with the portal version ? Now i use 2.0 final and then it was 2.0 RC1 as far as i remember. Maybe now i should do something more than just adding a tag to get it work (something to change in some xmls - no idea) ?

            The reason i do it that way, then changing whole JSPWiki code is that i wanted to leave oportunity to upgrade to the newst version of jspwiki as easy as possible.

            anyway thank you very much for reply,
            Tomek