[jboss-user] [JBoss Portal] - How to access Portlet Information in Edit functionality

david.hoffman do-not-reply at jboss.com
Wed Oct 25 14:43:59 EDT 2006


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?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980804#3980804

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980804



More information about the jboss-user mailing list