Forums

Home » Liferay Portal » English » Liferay Legacy

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Rodolfo Morais
Retrieve data via Ajax
August 18, 2006 2:59 PM
Answer

Rodolfo Morais

Rank: New Member

Posts: 10

Join Date: July 31, 2006

Recent Posts

How could I retrieve data from by web application, within Liferay's session via AJAX ?

Liferay's current implementation renders the entire portlet via AJAX through the Ajax.js script that is provided.

Does Liferay currently provide a capability to support data retrieval from a portlet without rendering the portal and portlet themes?
Mika Koivisto
RE: Retrieve data via Ajax
August 18, 2006 11:59 PM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1513

Join Date: August 7, 2006

Recent Posts

You could use DWR (Direct Web Remoting). That is the easiest AJAX framework there is. Just add the DWR servlet in your portlet wars web.xml. You might want to secure the servlet if you are exposing services that are only for logged in users. Also in JBoss-tomcat you need to enable Tomcat's single sign-on across web apps by uncommenting following line in jbossweb-tomcat55.sar/server.xml

1<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
Huy Ho
RE: Retrieve data via Ajax
August 22, 2006 9:11 AM
Answer

Huy Ho

Rank: Regular Member

Posts: 177

Join Date: April 18, 2006

Recent Posts

Hi Mika,
I am testing out DWR for my portlet's data update, but security is a concern. How do you suggest i can secure this servlet to be only accessible by logged-in users? Thanks.
Huy.
Mika Koivisto
RE: Retrieve data via Ajax
August 22, 2006 9:36 AM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1513

Join Date: August 7, 2006

Recent Posts

Just add security-constraint to your web.xml as per servlet specification.
 1    <security-constraint>
 2        <web-resource-collection>
 3            <web-resource-name>dwr</web-resource-name>
 4            <url-pattern>/dwr/*</url-pattern>
 5            <http-method>GET</http-method>
 6            <http-method>POST</http-method>
 7        </web-resource-collection>
 8        <auth-constraint>
 9            <role-name>users</role-name>
10        </auth-constraint>
11        <user-data-constraint>
12            <transport-guarantee>NONE</transport-guarantee>
13        </user-data-constraint>
14    </security-constraint>