[jboss-user] [JBoss Portal] - Re: getPreferences with JSF portlet
franco12
do-not-reply at jboss.com
Mon Oct 16 10:57:31 EDT 2006
ok thanks for your help Thomas :)
I removed "extends GenericPortlet" and the doView method
and I updated getSupprimer() like this
| import javax.portlet.PortletPreferences;
| import javax.portlet.PortletSecurityException;
| import javax.portlet.RenderRequest;
| import javax.portlet.RenderResponse;
| import javax.portlet.PortletException;
| import java.io.IOException;
|
| public class MDP_contribution_consultation
| {
| String consulter="ok";
| String supprimer;
| private String init="false";
|
| public String getConsulter()
| {
| return consulter;
| }
|
| public void setConsulter(String consulter)
| {
| this.consulter = consulter;
| }
|
| public String getSupprimer(RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
| {
| PortletPreferences prefs = request.getPreferences();
| String parameter = prefs.getValue("edit",init);
| if (parameter.equals("true"))
| {
| return "ok";
| }
| else
| {
| return "pas ok";
| }
| }
|
| public void setSupprimer(String supprimer)
| {
| this.supprimer = supprimer;
| }
| }
|
now I'm having this error
An error occured while rendering window 'default.MaPage.contrib'
|
| org.apache.jasper.JasperException: Bean: MDP_contribution_consultation, property: supprimer
my portlet.xml has a jsp page as an init parameter, like this
<portlet-app version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/portlet"
| xmlns="http://java.sun.com/xml/ns/portlet">
| <portlet>
| <portlet-name>MDP_contribution_consultation</portlet-name>
| <portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class>
| <portlet-info>
| <title>MDP_contribution_consultation</title>
| </portlet-info>
| <init-param>
| <name>default-view</name>
| <value>/WEB-INF/jsp/view.jsp</value>
| </init-param>
| <init-param>
| <name>suppression_init</name>
| <value>false</value>
| </init-param>
| <portlet-preferences>
| <preference>
| <name>edit</name>
| <value>true</value>
| </preference>
| </portlet-preferences>
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| </supports>
| </portlet>
| </portlet-app>
|
regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978565#3978565
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978565
More information about the jboss-user
mailing list