0 Replies Latest reply on Oct 25, 2006 2:43 PM by david.hoffman

    How to access Portlet Information in Edit functionality

    david.hoffman

      I have a portlet that is EDITable. In my portlet class, I have the following

      protected void doEdit(RenderRequest request, RenderResponse response) throws IOException, PortletException {
       response.setContentType("text/html");
       PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/edit.jsp");
       dispatcher.include(request, response);
      }
      


      In my "/WEB-INF/jsp/edit.jsp" I have the following:

      <%@ page isELIgnored="false" %>
      <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
      
      <portlet:defineObjects/>
      <%
      String NUMBER_OF_STORIES = renderRequest.getPortletSession().getPortletContext().getInitParameter("number_of_stories");
      %>
       <form method="post" action="<portlet:actionURL></portlet:actionURL>">
       <input type="text" name="number" value="<%=NUMBER_OF_STORIES%>">
       </form>
      


      and in my portlet.xml I have

       <init-param>
       <name>number_of_stories</name>
       <value>3</value>
       </init-param>
      


      Inside the Portlet class itself, I am able to getInitParameter("number_of_stories") successfully, but in my edit.jsp all I ever get back is "null".

      How do I access the init-param values in my edit.jsp?