1 Reply Latest reply on Nov 20, 2006 11:47 AM by Peter Johnson

    Creating a Portal from JSP Pages

    Niraj Patel Newbie

      I am trying to create a jsp portal using some jsp pages that a developer created. His file structure is a bit different than the one used in the "HelloWorldJSPPortlet" example in the documentation. I follow the documentation but it doesn't seem to register in as a Portlet when I deploy the WAR file. I can create an instance of the object but it registers as an existing portlet instead of creating a new jsp portlet. Here are a few questions that I have that if answered may help solve my issues.

      1. What is the recommended file structure for the project or .war file?
      2. Do portlet tags need to be added to the jsp files? If so, what would they be in the most simpliest example?
      3. What needs to be in my .java file in the most simpliest example?

      The HelloWorld example is not clear enough and/or is too difficult to mimic. Any help would be greatly appreciated. Any "real world" jsp deployment examples would be very helpful.

      Thanks!

        • 1. Re: Creating a Portal from JSP Pages
          Peter Johnson Master

          1) I don't know if a standard war layout, but here is what mine looks like:

          ./WEB-INF/classes/com/xxx/ImagePortlet.class
          ./WEB-INF/classes/com/xxx/ImageBean.class
          ./WEB-INF/classes/com/xxx/message.properties
          ./WEB-INF/lib/standard-1.1.2.jar
          ./WEB-INF/jsp/help.jsp
          ./WEB-INF/jsp/edit.jsp
          ./WEB-INF/jsp/view.jsp
          ./WEB-INF/jboss-app.xml
          ./WEB-INF/image-object.xml
          ./WEB-INF/web.xml
          ./WEB-INF/portlet-instances.xml
          ./WEB-INF/portlet.xml


          In my portlet doView code, I access the view jsp as follows:

          protected void doView(RenderRequest request,
           RenderResponse response) throws PortletException, IOException{
           . . .
           PortletRequestDispatcher prd =
           getPortletContext().getRequestDispatcher("WEB-INF/jsp/view.jsp");
           prd.include(request, response);
           }



          2) No. I never use the protlet tags in my JSPs, only the standard tags. You need the portlet tags only if you plan to generate URLs within the JSP itself. In my case, I generate the URL within my portlet code and pass it out to the JSP using a bean.

          3) The Manning sandbox contains a draft manuscript on portals and portlets by Hepper etal (http://www.manning.com/hepper/). You must register to enter the sandbox but registration is free. It helped me, and the price was right. It has a more complete JSP example.