2 Replies Latest reply on Oct 26, 2005 4:46 AM by pedro costa

    how run JSP in Jboss Portal?

    pedro costa Apprentice

      I created a portlet that works with servlets code. But, when i try to use the portlet with JSP, it doesn't appear anything when I run my portlet.

      I only have doView method declared. What i put in doView method is

      String reqPath = ?/calView.jsp?;
      PortletRequestDispatcher prd = portContext.getRequestDispatcher(reqPath);
      prd.include(req, resp);

      But, my jsp file doesn't appear when i call my file. I suppose that jsp file is in the right path, because i don't have any exception. So, i deduce that portal reads or tries to read my file, but it doesn't show anything.
      What's wrong?

      Another question. If i've in my file doView and doEdit methods declared, how do i say to run defaultly the doView method?

      Thanks

        • 1. Re: how run JSP in Jboss Portal?
          pedro costa Apprentice

          Here is my code


          public class Test extends GenericPortlet {

          protected void doView(RenderRequest request, RenderResponse response)
          throws PortletException, IOException
          {
          response.setContentType("text/html");

          String reqPath="/view.jsp";
          PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(reqPath);
          prd.include(request, response);




          }
          }


          Here is my jsp code

          <%@ page session="false" %>
          <%@ page import="javax.portlet.*"%>
          <%@ page import="java.util.*"%>
          <%@ taglib uri='/WEB-INF/tld/portlet.tld' prefix='portlet'%>
          <portlet:defineObjects/>

          Hello,
          I am the bookmark portlet.

          Current Portlet Mode: <%=renderRequest.getPortletMode()%>
          Current Window State: <%=renderRequest.getWindowState()%>

          • 2. Re: how run JSP in Jboss Portal?
            pedro costa Apprentice

            Never mind, i've resolved the problem.