Spring Portlet MVC - Accessing Portlet-Preferences during
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Portal Server > Spring Portlet MVC - Accessing Portlet-Preferences during




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Spring Portlet MVC - Accessing Portlet-Preferences during  
iops@gmx.de


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-27-07 12:36 PM

Hi!<br />
<br />
I'm developing a portlet-app with Spring Portlet MVC.<br />
<br />
I would like to use the Portlet-Preferences to configure the app.<br />
I need only one set of Preferences for all users and all pages. <br />
Only the admin should be able to edit them.<br />
<br />
For that I want to read the Portlet-Preferences during the<br />
initialization of the Spring-Context. (Done by org.springframework.web.conte
xt.ContextLoaderListener in web.xml)<br />
<br />
Any idea, how I could access the Portlet-Preferences in Spring-Initializatio
n?<br />
I know the Portlet-Preferences are bound to requests and so to a page and a 
user,<br />
but these informations doesn't bother me. I just want to read the basic pref
erences-level<br />
valid for all users and all pages.<br />
<br />
How do others solve this issue, with Spring Portlet MVC?<br />
<br />
Regards, Herbert





[ Post a follow-up to this message ]



    Re: Spring Portlet MVC - Accessing Portlet-Preferences during  
Ryan Wilson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-27-07 12:36 PM

As you are ware you need the PortletRequest in order to access PortletPrefer
ences.<br />
Since ContextLoadListener will only provide you with the ServletContext you 
could use context-params in the web.xml.<br />
These values will also be available in the PortletContext. <br />
<br />
Ryan<br />
<br />
SCJP & SCWCD<br />
IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0<br />
<br />
The postings on this site are my own and do not necessarily represent the po
sitions, strategies, or opinions of IBM





[ Post a follow-up to this message ]



    Re: Spring Portlet MVC - Accessing Portlet-Preferences during  
iops@gmx.de


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-27-07 06:32 PM

Hi Ryan!<br />
<br />
Thanks for your answer!<br />
<br />
Yes, I could use the context-params in ServletContext.<br />
<br />
Am I right, that in this case, I can't use the PortletPreferences-mechanism<
br />
to save the params? So I would have to implement <br />
my own preferences-logic?<br />
<br />
I would like to use the built in mechanism of portal-servers.<br />
Maybe there is a way to combine the context-params of ServletContext with Po
rtletPreferences?<br />
<br />
Regards, Herbert





[ Post a follow-up to this message ]



    Re: Spring Portlet MVC - Accessing Portlet-Preferences during  
Ryan Wilson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-27-07 06:32 PM

In order to use portletpreferences you need the request.  I'm by no means a 
Spring expert but from what I can see in the API you do not have access to t
he request.<br />
<br />
You could create your own custom preference mechanism by using something lik
e a portlet service but this add much more complexity then is really needed.
<br />
Why are you opposed to using context-params?<br />
<br />
Ryan<br />
<br />
SCJP & SCWCD<br />
IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0<br />
<br />
The postings on this site are my own and do not necessarily represent the po
sitions, strategies, or opinions of IBM





[ Post a follow-up to this message ]



    Re: Spring Portlet MVC - Accessing Portlet-Preferences during  
iops@gmx.de


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-29-07 06:32 PM

Hi Ryan!<br />
<br />
<div class="jive-quote">Why are you opposed to using context-params?</div>
<br />
I don't have that much experience with spring and portal and I'm just <br />
thinking about different ways to solve my issue. <br />
<br />
I justed liked the idea of using the built-in mechanism.





[ Post a follow-up to this message ]



    Re: Spring Portlet MVC - Accessing Portlet-Preferences during  
Ryan Wilson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-29-07 06:32 PM

context-params are a built in mechanism and as stated earlier these values w
ould also be available in the PortletContext.<br />
I think this would be the easiest solution to your problem.<br />
<p />
Ryan<br />
<br />
SCJP & SCWCD<br />
IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0<br />
<br />
The postings on this site are my own and do not necessarily represent the po
sitions, strategies, or opinions of IBM





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:12 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register